Repository navigation
Commit 1b2d97e
authored
ADFA-4755: stop reporting benign stale-classpath failures from Kotlin LSP indexer (#1550)
* ADFA-4755: don't report benign stale-classpath failures from Kotlin LSP indexer
GlitchTip issue CODEONTHEGO-D is our own telemetry, not a crash. During
source-file indexing, FIR resolution tried to read a dependency jar that no
longer existed on disk - a Gradle transform-cache entry evicted or rebuilt
while indexing was in flight - and threw NoSuchFileException wrapped in
KotlinIllegalArgumentExceptionWithAttachments. analyzeDeclaration already
caught it and reported it via Sentry.captureException (userCount: 0). The
condition is benign and transient: the next index pass, once the build
settles, succeeds.
- Add Throwable.isMissingClasspathFile(): walks the cause chain for
NoSuchFileException / FileNotFoundException (bounded against self-cause).
- analyzeDeclaration: skip Sentry reporting for these (debug-log instead),
so we stop emitting this noise.
- indexSourceFile: wrap the analysis block in the module's standard degrade
guard (rethrow CancellationException; report+skip otherwise). A setup-time
escape - outside the per-declaration runCatching - would otherwise reach
KtSymbolIndex.scope, which has no CoroutineExceptionHandler, and crash the
app (the hazard OrganizeImportsAction already documents).
Adds predicate unit tests. Most of the file diff is a mandatory Spotless
full-file reformat triggered by the origin/stage ratchet; see `git diff -w`
for the behavioral change.
* ADFA-4755: document why the indexer backstop catches Throwable
Preempts a review suggestion to narrow the catch: this scope has no
CoroutineExceptionHandler, so narrowing to Runtime/IOException would let
Error-type failures (StackOverflowError, LinkageError) crash the app instead
of degrading. No behavior change.
* ADFA-4755: rethrow CancellationException from analyzeDeclaration's runCatching
runCatching catches Throwable, so a cancellation during symbol analysis would
be swallowed and mis-reported to Sentry instead of aborting. Rethrow it first,
matching the module's other analysis handlers. Addresses CodeRabbit review.1 parent 88c20f3 commit 1b2d97e
2 files changed
Lines changed: 366 additions & 208 deletions
File tree
- lsp/kotlin/src
- main/java/com/itsaky/androidide/lsp/kotlin/compiler/index
- test/java/com/itsaky/androidide/lsp/kotlin/compiler/index
0 commit comments