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

Allow AccountSetup to be created with async function to handle completeness of the account setup #73

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

pauljohanneskraft
Copy link
Contributor

@pauljohanneskraft pauljohanneskraft commented Sep 3, 2024

Allow AccountSetup to be created with async throwing function to handle completeness of the account setup

♻️ Current situation & Problem

When an account setup is successful, one may want to run additional code that is async and throwing to finish the account setup completely.

Specifically in ENGAGE-HF, we need to call a Firebase function when a new account has been created before the account can actually be used.

⚙️ Release Notes

  • Allow setupComplete parameter in AccountSetup to be async-throwing.

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.

📝 Code of Conduct & Contributing Guidelines

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

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 87.30159% with 8 lines in your changes missing coverage. Please review.

Project coverage is 83.74%. Comparing base (397a55a) to head (76ceb51).

Files with missing lines Patch % Lines
Sources/SpeziAccount/AccountSetup.swift 86.00% 7 Missing ⚠️
...Account/ViewModifier/AccountRequiredModifier.swift 92.31% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
- Coverage   84.36%   83.74%   -0.61%     
==========================================
  Files         120      120              
  Lines        5221     5158      -63     
==========================================
- Hits         4404     4319      -85     
- Misses        817      839      +22     
Flag Coverage Δ
83.74% <87.31%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../SpeziAccount/Environment/AccountRequiredKey.swift 100.00% <ø> (ø)
...Account/ViewModifier/AccountRequiredModifier.swift 91.53% <92.31%> (+3.07%) ⬆️
Sources/SpeziAccount/AccountSetup.swift 88.83% <86.00%> (-3.24%) ⬇️

... and 27 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 397a55a...76ceb51. Read the comment docs.

Copy link
Member

@Supereg Supereg left a comment

Choose a reason for hiding this comment

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

Thanks for the great work 🚀

I think the PR is generally in a good shape. Just had a few comments and ideas that discusses some of the detailed design of this PR.

Sources/SpeziAccount/AccountSetup.swift Outdated Show resolved Hide resolved
Sources/SpeziAccount/AccountSetup.swift Outdated Show resolved Hide resolved
Sources/SpeziAccount/AccountSetup.swift Outdated Show resolved Hide resolved
Sources/SpeziAccount/AccountSetup.swift Outdated Show resolved Hide resolved
@pauljohanneskraft pauljohanneskraft changed the title Allow AccountSetup to be created with async throwing function to handle completeness of the account setup Allow AccountSetup to be created with async function to handle completeness of the account setup Sep 12, 2024
@pauljohanneskraft
Copy link
Contributor Author

I reverted the changes that are needed in ENGAGE-HF and will open a different PR instead, since this might still be a nice addition, but actually isn't needed urgently anymore.

Feel free to keep this open / ask for adaptions though!

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for the work here @pauljohanneskraft! I had a comment about the API surface were we could improve the naming; apart from this the change looks good and once @Supereg's comment are addressed we can merge this as a nicer generalization of this feature.

Sources/SpeziAccount/AccountSetup.swift Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants