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

fix(auth): add missing is_anonymous field #355

Merged
merged 3 commits into from
Apr 29, 2024
Merged

fix(auth): add missing is_anonymous field #355

merged 3 commits into from
Apr 29, 2024

Conversation

grdsdev
Copy link
Collaborator

@grdsdev grdsdev commented Apr 26, 2024

What kind of change does this PR introduce?

Close #354

What is the current behavior?

User object does not have a isAnonymous field.

What is the new behavior?

Add missing isAnonymous, and default it to false for backward compatibility.

Additional context

Add any other context or screenshots.

self.role = try container.decodeIfPresent(String.self, forKey: .role)
self.updatedAt = try container.decode(Date.self, forKey: .updatedAt)
self.identities = try container.decodeIfPresent([UserIdentity].self, forKey: .identities)
self.isAnonymous = try container.decodeIfPresent(Bool.self, forKey: .isAnonymous) ?? false
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is the fallback

Copy link
Member

@dshukertjr dshukertjr left a comment

Choose a reason for hiding this comment

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

There seems to be one test that is failing, but is it a flaky test?

@grdsdev
Copy link
Collaborator Author

grdsdev commented Apr 29, 2024

There seems to be one test that is failing, but is it a flaky test?

It should be a flaky test, but it is consistently failing for this PR, I'll try to fix it before merging it.

@grdsdev grdsdev merged commit 854dc42 into main Apr 29, 2024
9 checks passed
@grdsdev grdsdev deleted the fix/is_anonymous branch April 29, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session.User: isAnonymous field missed
5 participants