installations: getId() logs a handled registration failure with console.error; performance: getAuthTokenPromise() leaks it as an unhandled rejection
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- firebase, typescript
- Domain
- web-dev
Research direction
The files to edit are index.esm.js in @firebase/installations (around lines 871 and 876) and @firebase/performance (around lines 250-256). Remove the .catch(console.error) in installations and add a catch to the getToken().then(...) chain in performance. Done means a blocked registration yields a single rejection to the caller, no console.error, and no unhandled rejection. Run the unit tests for both packages to confirm.
Written by the indexing model from the issue text.
Description
Two emitters in the web SDK report a handled network failure as if the app were at fault, which shows up as two browser error events per page load on any client whose network blocks firebaseinstallations.googleapis.com (headless crawlers, locked-down corporate networks), with no fault in the app.
Observed (Datadog RUM, Next.js 16 app, @firebase/installations 0.6.24, @firebase/performance 0.7.14): the POST https://firebaseinstallations.googleapis.com/v1/projects/<id>/installations request is rejected at the client (status_code: 0, TypeError: Failed to fetch). At that instant:
@firebase/installationsgetId()logs the registration failure withconsole.error(index.esm.jsaround lines 871 and 876:registrationPromise.catch(console.error)), although every caller already receives the rejection and handles it. A library should not log a failure it also throws; the host application decides whether it is an error.@firebase/performancegetAuthTokenPromise()callsgetToken().then(...)without acatch(index.esm.jsaround lines 250–256), so the same failure surfaces as an unhandled promise rejection.
Expected: a failed Installations registration is returned to the caller once, as a rejection, and not also logged; Performance handles its own token fetch failure (a breadcrumb or silent disable), so it never produces an unhandled rejection.
Reproduce: load a page that initialises Installations/Performance with firebaseinstallations.googleapis.com blocked (a request-blocking rule in DevTools is enough). Observe one console.error and one unhandled rejection.
- Dominant language
- TypeScript
- Stars
- 5.2k
- Forks
- 1k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 77
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-js-sdk
-
AI: ChatSession.sendMessage / sendMessageStream throw TypeError on blocked prompts (empty candidates) when tools are setPossibly taken @abhiramshaji-cyber claimed this today. Openapi: firebaseai
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firebase/firebase-js-sdk#10641 ·
Maintainers usually reply within 1 day
-
api: firestore needs-attention question Repro Needed
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firebase/firebase-js-sdk#10595 ·
Maintainers usually reply within 1 day
-
@firebase/firestore pins @grpc/grpc-js to ~1.9.0, holding consumers on a flagged releasePossibly taken @cherylEnkidu claimed this 50 days ago. Openapi: firestore needs-attention question stack:Angular
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
firebase/firebase-js-sdk#10400 · 4 comments · 9 reactions · 1 assignee ·
Maintainers usually reply within 1 day
-
Some (sub) package.json do not list the licences which lead to tools like syft report unknown licencePossibly taken @phoekerson claimed this 84 days ago. Openquestion
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
firebase/firebase-js-sdk#9326 · 5 comments ·
Maintainers usually reply within 1 day
-
AI: ONLY_ON_DEVICE falls back to the cloud when the LanguageModel API is missingPossibly taken @hsubox76 claimed this 2 days ago. Openapi: firebaseai
Difficulty 3/5 1-2 days Newbie friendliness 35/100
firebase/firebase-js-sdk#10635 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in firebase/firebase-js-sdk
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
inabagumi/shinju-date#7406 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
umami-software/umami#4787 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day