firebase / firebase/firebase-admin-node
[FR]Why does admin.send() return just the response name as error instead of the full response object
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 16
Mô tả
**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
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- firebase, node.js, typescript
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100