firebase / firebase/firebase-admin-node

[FR] Include raw HTTPS responses in errors

Offen
#756 5 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
type: feature request
Vorherrschende Sprache
TypeScript
Sterne
1.7k
Forks
419
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
16

Beschreibung

**Is your feature request related to a problem? Please describe.**
I am converting APNs tokens to Firebase registration tokens ("FRTs") on-the-fly in a backend push service. Many converted FRTs fail with the error `messaging/invalid-argument`, with no clues of what's going on. Through some fairly time consuming debugging using the Google API Explorer I was able to get some more details on what was happening, but it's a frustrating process.

**Describe the solution you'd like**
Provide the raw HTTPS response in the thrown `FirebaseMessagingError`. The python SDK [has this](https://firebase.google.com/docs/reference/admin/python/firebase_admin.exceptions), so I think it makes sense that the Node one would too. It would be especially helpful in cases like this where the error code doesn't make much sense.

**Describe alternatives you've considered**
The only real option to attain more info would be to use the REST API directly, but that feels a little over the top.

**Additional context**
There's definitely a possibility that the server or app is misconfigured somehow. Fixing the error is not the point here, though!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, FirebaseMessagingError und den messaging/invalid-argument-Pfad im Node.js SDK nachzuverfolgen, und vergleiche anschließend die im Issue verlinkte Referenz zu Exceptions des Python SDK. Prüfe, wie HTTPS-Antworten derzeit behandelt werden, und ermittle die Tests, die Firebase Messaging-Fehler abdecken. Erledigt ist die Aufgabe, wenn ausgelöste Fehler die rohe HTTPS-Antwort offenlegen, ohne den bestehenden Fehlercode oder die bestehende Fehlermeldung zu verschleiern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
firebase, nodejs, typescript
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.