firebase / firebase/firebase-admin-node

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

未关闭
#2,693 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: messaging type: feature request
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

**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

贡献指南

打开贡献指南

调研方向

Start at the admin.send() entry point and compare its returned error with the deprecated sendToDevice method and the FirebaseError interface shown in the issue. Determine the response shape needed to expose status, error code, and message; done means callers can identify expired or invalid tokens from the returned response.

由索引模型根据 Issue 内容生成。

评估

技术栈
firebase, node.js, typescript
领域
api, backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。