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

Error InvalidSession on logout after delete user #8506

Open
FlamurBeqiri opened this issue Mar 8, 2024 · 7 comments
Open

Error InvalidSession on logout after delete user #8506

FlamurBeqiri opened this issue Mar 8, 2024 · 7 comments

Comments

@FlamurBeqiri
Copy link

FlamurBeqiri commented Mar 8, 2024

How frequently does the bug occur?

Always

Description

Once the delete account method is called with success we logout the user. Currently an error comes from Realm when trying to logout:

{
    "Error Code" = 2;
    "Error Name" = InvalidSession;
    NSLocalizedDescription = "invalid session: failed to find refresh token";
    "Server Log URL" = "";
}

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

Delete user
Logout User

Version

10.48.0

What Atlas Services are you using?

Atlas App Services: Functions or GraphQL or DataAPI etc

Are you using encryption?

No

Platform OS and version(s)

17.2

Build environment

Xcode version: 15.2
Dependency manager and version: SPM

Copy link

sync-by-unito bot commented Mar 8, 2024

➤ PM Bot commented:

Jira ticket: RCOCOA-2300

@nirinchev
Copy link
Member

Thanks for reporting this. It looks like this is indeed an oversight and should be easy to special-case to avoid throwing an error in the event we get a 404.

@tgoyne
Copy link
Member

tgoyne commented Mar 8, 2024

The error message isn't great, but otherwise this seems correct? You can't log out a user that doesn't exist, and I'm not sure why you're trying to.

@FlamurBeqiri
Copy link
Author

@tgoyne This was actually working before, this error shows now with some newer versions if I'm not mistaken. Usually the app flow works like this: Delete>Success>Logout.
Is there a better way to achieve the deletion process of a user?

@tgoyne
Copy link
Member

tgoyne commented Mar 8, 2024

What are you expecting the Logout step after deleting the user to do? It might have previously been a silent no-op rather than reporting an error, but it never could have done anything.

@FlamurBeqiri
Copy link
Author

Alright thnx for the Response

@nirinchev
Copy link
Member

I'll reopen this as a reminder to check that we handle the case where we log out a deleted user without throwing an exception. That should be fairly easy to detect and would be a minor improvement in the case where a user is deleted on one device and we attempt to log them out on another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants