Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#2,845 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
firebase, node.js, typescript

调研方向

首先,使用一个不存在的 UID 调用 Firebase Auth 的 admin.auth().getUser(uid) 和 deleteUser(uid),重现所报告的行为。检查提供的 TypeScript 函数如何处理 auth/user-not-found 错误,并确定缺失用户时的预期行为。对于查找和删除两种情况,都有记录或测试结果后,才算完成。

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

描述

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",
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
4 天 20 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-admin-node 的其他 Issue

查看 firebase/firebase-admin-node 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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