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

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

Đang mở
#1,785 0 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
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
cpp, javascript
Lĩnh vực
authentication

Hướng nghiên cứu

Bắt đầu với dự án ví dụ Firebase C++ Auth trên Windows và tái hiện việc đăng nhập bằng email/mật khẩu với hàm beforeUserSignedIn đã được triển khai trong min-viable-blocking.js. So sánh lỗi trên Windows với hành vi được mô tả cho Android, iOS và web, đồng thời kiểm tra các C++ quickstarts nếu cần. Hoàn tất khi ứng dụng khách Windows có thể truy cập lỗi failed-precondition của hàm blocking và dữ liệu bổ sung của lỗi đó.

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

Mô tả

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
    );
});
Ngôn ngữ chính
C++
Star
326
Fork
138
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
3

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-cpp-sdk

Tất cả issue của firebase/firebase-cpp-sdk

Issue tương tự

Thêm issue về C++

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.