Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#2,693 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 7 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
firebase, node.js, typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu tại điểm vào admin.send() và so sánh lỗi được trả về với phương thức sendToDevice đã lỗi thời và interface FirebaseError được nêu trong issue. Xác định cấu trúc phản hồi cần thiết để cung cấp status, mã lỗi và thông báo; hoàn thành khi các caller có thể xác định các token đã hết hạn hoặc không hợp lệ từ phản hồi được trả về.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
1.8k
Fork
420
Merge trung bình
5 ngày 6 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-admin-node

Tất cả issue của firebase/firebase-admin-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.