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

Added RetryCustomConfirmationAsync #3468

Merged
merged 3 commits into from
Nov 3, 2023
Merged

Added RetryCustomConfirmationAsync #3468

merged 3 commits into from
Nov 3, 2023

Conversation

papafe
Copy link
Contributor

@papafe papafe commented Nov 3, 2023

Fixes #3463

TODO

  • Changelog entry
  • Tests (if applicable)

@@ -92,6 +92,8 @@ public static void RunBaasTestAsync(Func<Task> testFunc, int timeout = 30000)

public static string GetVerifiedUsername() => $"realm_tests_do_autoverify-{Guid.NewGuid()}";

public static string GetUnconfirmedUsername() => $"realm_tests_do_not_confirm-{Guid.NewGuid()}@g.it";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

RetryCustomConfirmation will fail if the input doesn't look like a proper email. We could add the same to GetVerifiedUsername for consistency

{
let newVal = {
'email': username,
'token': token,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Saving the token and tokenId is not necessary now, but it could be useful if we want to write tests for ConfirmAsync

Copy link

Pull Request Test Coverage Report for Build 6743724741

  • 10 of 10 (100.0%) changed or added relevant lines in 2 files are covered.
  • 42 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.5%) to 79.67%

Files with Coverage Reduction New Missed Lines %
Realm/Realm/Handles/SessionHandle.cs 5 83.33%
Realm/Realm/Handles/SubscriptionSetHandle.cs 5 86.82%
Realm/Realm/Exceptions/CompensatingWriteException.cs 12 0.0%
Realm/Realm/Extensions/CollectionExtensions.cs 20 72.54%
Totals Coverage Status
Change from base Build 6704053440: -0.5%
Covered Lines: 6293
Relevant Lines: 7785

💛 - Coveralls

@papafe papafe changed the title Added methods Added RetryCustomConfirmationAsync Nov 3, 2023
Copy link
Member

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

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

Looks good.

// At the same time we save the user email in a collection.
await DefaultApp.EmailPasswordAuth.RegisterUserAsync(unconfirmedMail, SyncTestHelpers.DefaultPassword).Timeout(10_000, detail: "Failed to register user");

var ex3 = await TestHelpers.AssertThrows<AppException>(() => DefaultApp.LogInAsync(credentials));
Copy link
Member

Choose a reason for hiding this comment

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

Not super important, but why is this ex3 rather than just ex?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because before I had the sections in the opposite order and I forgot to rename the exceptions 😁

@papafe papafe merged commit b8dce53 into main Nov 3, 2023
76 of 79 checks passed
@papafe papafe deleted the fp/email-password branch November 3, 2023 13:08
@papafe papafe restored the fp/email-password branch November 3, 2023 14:01
nirinchev added a commit that referenced this pull request Nov 4, 2023
* main:
  Prepare for vNext (#3473)
  Prepare for 11.6.0 (#3470)
  Added RetryCustomConfirmationAsync (#3468)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose App.EmailPassword.retryCustomConfirmation
2 participants