Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix messaging errors #43

Merged
merged 8 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: dart analyze

- name: Run tests
run: ${{github.workspace}}/scripts/coverage.sh
run: firebase emulators:exec --project dart-firebase-admin --only auth,firestore "dart test"

- name: Upload coverage to codecov
run: curl -s https://codecov.io/bash | bash
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Millis",
"OIDC",
"pbkdf",
"responsetype",
"rrggbb",
"rrggbbaa",
"SIGNIN",
Expand Down
5 changes: 4 additions & 1 deletion packages/dart_firebase_admin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Unreleased fix
## Unreleased minor

- Fixes some errors incorrectly coming back as "unknown".
- Renamed various error codes to remove duplicates and removed
unused codes.
- Fixes crash when updating users (thanks to @HeySreelal)
- Marked various classes that cannot be extended as base/final.

Expand Down
11 changes: 10 additions & 1 deletion packages/dart_firebase_admin/lib/src/app/firebase_admin.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
part of '../app.dart';

class FirebaseAdminApp {
FirebaseAdminApp.initializeApp(this.projectId, this.credential);
FirebaseAdminApp.initializeApp(
this.projectId,
this.credential, {
Client? client,
}) : _clientOverride = client;

/// The ID of the Google Cloud project associated with the app.
final String projectId;
Expand Down Expand Up @@ -31,8 +35,13 @@ class FirebaseAdminApp {
auth3.IdentityToolkitApi.firebaseScope,
],
);
final Client? _clientOverride;

Future<Client> _getClient(List<String> scopes) async {
if (_clientOverride != null) {
return _clientOverride;
}

if (isUsingEmulator) {
return _EmulatorClient(Client());
}
Expand Down
Loading
Loading