StanfordSpezi / SpeziFirebase

Google Firebase Spezi Modules
https://swiftpackageindex.com/StanfordSpezi/SpeziFirebase/documentation/
MIT License
3 stars 2 forks source link

Several fixes for the FirebaseAccountService #43

Closed Supereg closed 2 weeks ago

Supereg commented 2 weeks ago

Several fixes for the FirebaseAccountService

:recycle: Current situation & Problem

This PR introduces several improvements for the FirebaseAccountService and fixes some bugs and issues. We fixed an issue where the initial account would not be associated correctly and the following stateDidChange call would always be ignored independent if the state actually changed between the initial check and the call. Further, we made minor changes to make sure that no user account is associated when we try to login or signup for a new user account. We previously always relied on the stateDidChange change handler to be called to complete operations like signup/signin/logout/delete. These operations now no longer rely on the stateDidChange listener to be called and instead always propagate their changes themselves.

:gear: Release Notes

:books: Documentation

--

:white_check_mark: Testing

--

:pencil: Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 82.14286% with 35 lines in your changes missing coverage. Please review.

Project coverage is 66.76%. Comparing base (12e7b77) to head (271753b). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../SpeziFirebaseAccount/FirebaseAccountService.swift 82.15% 35 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43/graphs/tree.svg?width=650&height=150&src=pr&token=Z84BufPFgU&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #43 +/- ## ========================================== + Coverage 66.61% 66.76% +0.15% ========================================== Files 19 19 Lines 1087 1176 +89 ========================================== + Hits 724 785 +61 - Misses 363 391 +28 ``` | [Files with missing lines](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [.../SpeziFirestore/DocumentReference+AsyncAwait.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?src=pr&el=tree&filepath=Sources%2FSpeziFirestore%2FDocumentReference%2BAsyncAwait.swift&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUZpcmVzdG9yZS9Eb2N1bWVudFJlZmVyZW5jZStBc3luY0F3YWl0LnN3aWZ0) | `58.34% <ø> (ø)` | | | [.../SpeziFirebaseAccount/FirebaseAccountService.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?src=pr&el=tree&filepath=Sources%2FSpeziFirebaseAccount%2FFirebaseAccountService.swift&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUZpcmViYXNlQWNjb3VudC9GaXJlYmFzZUFjY291bnRTZXJ2aWNlLnN3aWZ0) | `71.09% <82.15%> (-0.34%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [12e7b77...271753b](https://app.codecov.io/gh/StanfordSpezi/SpeziFirebase/pull/43?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi).
PSchmiedmayer commented 2 weeks ago

Thank you for adding this @Supereg!