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

Find or delete non-existing UID results to prevent an uncacheable error.

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

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
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
firebase, node.js, typescript
Lĩnh vực
authentication

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi được báo cáo với các lệnh gọi admin.auth().getUser(uid) và deleteUser(uid) của Firebase Auth bằng một UID không tồn tại. Xem xét cách hàm TypeScript được cung cấp xử lý lỗi auth/user-not-found và xác định hành vi dự kiến đối với người dùng không tồn tại. Công việc được coi là hoàn tất khi có kết quả được ghi lại hoặc kiểm thử cho cả trường hợp tra cứu và xóa.

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

Mô tả

api: auth

Platform:

  • Operating System version: MacOs - Darwin 23.6.0 arm64 arm
  • Firebase SDK version: 11.11.1
  • Firebase Product: Firebase Auth
  • Bun version: 1.2.2 (Don't think is related)
  • NPM version: 10.8.2

Problem:
Whenever I try to find a user that doesn't exist or delete a uid that doesn't exist it thorws an error that breaks the function and is not cachable for some reaons, and its very weird behavirous that im not able to handle, i tried to use try catch, and then catch, but still the same. This has no steep to reprpoduce the error, its default behaviour.

Code:

import { Firebase } from '@/libs/firebase'
import { Console } from '@/helpers/logs'

const admin = await Firebase()

const DeleteFirebaseAccount = async (uid: string): Promise<boolean> => {
    try {
        const userExists = await admin.auth().getUser(uid)
        if (userExists) await admin.auth().deleteUser(uid)

        return true
    } 
    
    catch (error) {
        Console.Error('DeleteFirebaseAccount', error)
        return false
    }
}

export default DeleteFirebaseAccount

The error:

class FirebaseError extends Error {
29 |     constructor(errorInfo) {
30 |         super(errorInfo.message);
             ^
error: There is no user record corresponding to the provided identifier.
  errorInfo: {
  code: "auth/user-not-found",
  message: "There is no user record corresponding to the provided identifier.",
},
 codePrefix: "auth",
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
4 ngày 20 giờ
Pull request đã merge (30 ngày)
16

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.