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

feat: Add user changes stream #21

Merged
merged 3 commits into from
Nov 12, 2023
Merged

feat: Add user changes stream #21

merged 3 commits into from
Nov 12, 2023

Conversation

naipaka
Copy link
Contributor

@naipaka naipaka commented Nov 12, 2023

🙌 What I did

  • Add user changes stream

✍️ What I didn't do

  • Add test

✅ Verification

  • Android
  • iOS
  • macOS
  • Web

Screenshots

Additional Information

I made it public because I wanted to use userChanges!

@github-actions github-actions bot added the test label Nov 12, 2023
@naipaka naipaka marked this pull request as ready for review November 12, 2023 06:38
Copy link

codecov bot commented Nov 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4b15308) 54.40% compared to head (c5be867) 54.40%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #21   +/-   ##
=======================================
  Coverage   54.40%   54.40%           
=======================================
  Files          10       10           
  Lines         261      261           
=======================================
  Hits          142      142           
  Misses        119      119           
Files Coverage Δ
...utterfire_authenticator/lib/src/authenticator.dart 9.30% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@naipaka naipaka requested a review from riscait as a code owner November 12, 2023 06:38
@@ -29,6 +29,9 @@ class Authenticator {
/// 現在サインイン中のユーザー。サインインしていない場合はnullを返す。
User? get user => _auth.currentUser;

/// Listens for changes to the currently signed-in user.
Stream<User?> get userChanges => _auth.userChanges();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

badge
Is Getter better than late final here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just like Configurator's onConfigUpdated, that approach is less likely to lead to unexpected behavior...!
When exposing a Stream, it's basically better to use late final. Thank you 🙏

@@ -14,6 +14,7 @@ void main() {
class MockAuth extends Fake implements FirebaseAuth {}

// TODO(riscait): add more tests
// https://github.com/altive/flutterfire_adapter/issues/20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

badge
Thanks for adding the Issue link!

@naipaka naipaka force-pushed the add-user-changes-stream branch from 3bcb7cf to c5be867 Compare November 12, 2023 06:50
@naipaka naipaka requested a review from riscait November 12, 2023 06:53
@naipaka
Copy link
Contributor Author

naipaka commented Nov 12, 2023

I'll merge this for now! If there seems to be a problem, I'll fix it in a separate PR 🙏

@naipaka naipaka merged commit bafbfed into main Nov 12, 2023
6 checks passed
@naipaka naipaka deleted the add-user-changes-stream branch November 12, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants