fix: firebase FetchException wrapping and missing ADR doc#151
fix: firebase FetchException wrapping and missing ADR doc#151kirich1409 merged 1 commit intomainfrom
Conversation
…g ADR doc reference - FirebaseConfigValueProvider.fetch() was re-throwing RuntimeException bare, bypassing the FetchException wrapper the tests and docs contract requires - Remove ADR 001 nav entry from mkdocs.yml and dead link from best-practices.md (the file was never created, causing mkdocs --strict to abort) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Review Summary by QodoFix Firebase exception wrapping and remove missing ADR references
WalkthroughsDescription• Fix Firebase exception handling to wrap RuntimeException in FetchException • Remove references to non-existent ADR 001 documentation file • Resolve failing tests and documentation build failures Diagramflowchart LR
A["RuntimeException re-throw"] -->|Remove bare catch| B["FetchException wrapper"]
C["ADR 001 nav entry"] -->|Delete| D["Valid mkdocs config"]
E["Dead link in best-practices"] -->|Remove| F["Clean documentation"]
File Changes1. providers/firebase/src/main/kotlin/dev/androidbroadcast/featured/firebase/FirebaseConfigValueProvider.kt
|
Code Review by Qodo
1. Cancellation wrapped into FetchException
|
There was a problem hiding this comment.
Pull request overview
Fixes Firebase Remote Config fetch error propagation to consistently throw FetchException, and resolves MkDocs strict build failures caused by references to a missing ADR document.
Changes:
- Remove
RuntimeExceptionpassthrough inFirebaseConfigValueProvider.fetch()so task failures are wrapped inFetchException. - Remove missing ADR entry from
mkdocs.ymlnav. - Remove dead ADR link from
docs/guides/best-practices.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| providers/firebase/src/main/kotlin/dev/androidbroadcast/featured/firebase/FirebaseConfigValueProvider.kt | Adjusts exception handling so fetch failures are wrapped as FetchException. |
| mkdocs.yml | Removes nav entry pointing to a non-existent ADR doc to satisfy strict docs build. |
| docs/guides/best-practices.md | Removes a dead link to the missing ADR doc. |
| try { | ||
| task.await() | ||
| } catch (e: RuntimeException) { | ||
| throw e | ||
| } catch (e: Exception) { | ||
| throw FetchException("Firebase Remote Config fetch failed", e) | ||
| } |
There was a problem hiding this comment.
fetch() wraps all Exceptions from task.await() into FetchException. Since await() is cancellable, coroutine cancellation will throw CancellationException and should be rethrown (not wrapped), otherwise cancellation semantics are broken and callers may fail to cancel work properly. Add a catch (e: CancellationException) { throw e } before the generic catch (and import kotlinx.coroutines.CancellationException).
Summary
FirebaseConfigValueProvider.fetch()had acatch (e: RuntimeException) { throw e }block that re-threwRuntimeExceptionbare, bypassing theFetchExceptionwrapper. Tests inject aRuntimeExceptiontask failure and assertFetchException— this fixes 2 failing tests inFirebaseConfigValueProviderTest.adr/001-configvalues-multi-module.mdwas referenced in the MkDocs nav and linked fromguides/best-practices.mdbut the file was never created.mkdocs build --strictaborted on 2 warnings. Removed the nav entry and dead link.Test plan
Tests & Coveragejob passes (FirebaseConfigValueProviderTestno longer fails)Build Docsjob passes (mkdocs build --strictno longer aborts)🤖 Generated with Claude Code