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

[Bug] Errors fail to return all data from error object.

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

从 Firebase C++ Auth Windows 示例项目开始,针对部署在 min-viable-blocking.js 中的 beforeUserSignedIn 函数复现电子邮件/密码登录。将 Windows 错误与 Android、iOS 和 web 中描述的行为进行比较,并在需要时检查 C++ quickstarts。当 Windows 客户端能够访问 blocking 函数的 failed-precondition 错误及其附加数据时,即表示完成。

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

描述

api: auth new type: question
[REQUIRED] Please fill in the following fields:
  • Pre-built SDK from the website or open-source from this repo: _____
  • Firebase C++ SDK version: 13.0.0 (assuming flutterfire uses the latest version)
  • Problematic Firebase Component: Auth (Auth, Database, etc.)
  • Other Firebase Components in use: Firestore (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: Windows (iOS, Android, and/or desktop)
[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

When signing in with email and password, my project has a 'beforeUserSignIn' blocking function running before logging in that throws an HttpsError. On android/ios/web, throwing an HttpsError within the blocking function can be detected by the client attempting login, with it able to read the contents (i.e. that the HttpsError is 'failed-precondition').

On Windows, errors from the blocking function are clobbered into 'unknown-error' and any extra data in the HttpError is inaccessible.

Login when the blocking function immediately returns without error works as intended.

It may be because the firebase C++ SDK doesn’t provide any field or method for accessing additional error details. I would probably need a way to return the entire object back.

(Was redirected from https://github.com/firebase/flutterfire/issues/17592, so if I need to give you any more information please let me know (or if this issue isn't relevant to this project))

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase C++ quickstarts ?
What's the issue repro rate? (eg 100%, 1/5 etc)
I have not attempted this yet.

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Using the example project on Windows, sign in with email and password whilst a blocking function has been configured and deployed.

You may need to configure the function in the Firebase Console at Authentication > Settings > Blocking Functions.

I was able to replicate the issue with this cloud function deployed.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

min-viable-blocking.js

import { HttpsError, beforeUserSignedIn } from "firebase-functions/v2/identity";
import { setGlobalOptions } from 'firebase-functions/v2'

const functionConfig = {
    region: "asia-south1",
    concurrency: 60,
    minInstances: 0,
    maxInstances: 10,
    cpu: 1.0,
};

setGlobalOptions(functionConfig);

export const beforeSignIn = beforeUserSignedIn( (event)  => {
    throw new HttpsError(
        "failed-precondition",
        "error message for the client to read", 
        {'usefulData': 'drink some water'} //<-- this is the data i want to access from the error object
    );
});
主要语言
C++
星标
326
派生
138
平均合并
1 天 22 小时
30 天内合并 PR
6

环境准备

从这里开始

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

firebase/firebase-cpp-sdk 的其他 Issue

查看 firebase/firebase-cpp-sdk 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

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