Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[FR]Why does admin.send() return just the response name as error instead of the full response object

Aperta
#2,693 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
firebase, node.js, typescript
Ambito
api, backend

Direzione di ricerca

Inizia dal punto di ingresso admin.send() e confronta l'errore restituito con il metodo sendToDevice deprecato e l'interfaccia FirebaseError mostrata nell'issue. Determina la struttura della risposta necessaria per esporre status, il codice di errore e il messaggio; il lavoro è completato quando i chiamanti possono identificare i token scaduti o non validi dalla risposta restituita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

api: messaging type: feature request

Is your feature request related to a problem? Please describe.

I need to be able handle and cleanup tokens that have expired or are not working for whatever reason. I just migrated from sendToDevice to send and I was surprise that only a string response/error is returned when send is called.

Describe the solution you'd like

A response object that contains status, error code and message

similar to the return type of the now deprecated sendToDevice method

export interface FirebaseError {

code: string;

message: string;

stack?: string;

toJSON(): object;

}

Describe alternatives you've considered

There is no exhaustive list of all the error so there is no way for me to know when to remove expired token from my DB or keep them

Additional context

it is a bit wierd that other methods get a proper error object but send just gets a string error

Lingua principale
TypeScript
Stelle
1.7k
Fork
419
Merge medio
4g 20h
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firebase/firebase-admin-node

Tutte le issue di firebase/firebase-admin-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.