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

Incorrect Enum Value for UserState? #5203

Open
mk04366 opened this issue Dec 26, 2022 · 2 comments
Open

Incorrect Enum Value for UserState? #5203

mk04366 opened this issue Dec 26, 2022 · 2 comments

Comments

@mk04366
Copy link

mk04366 commented Dec 26, 2022

How frequently does the bug occur?

All the time

Description

I was facing a crash related to realm user not found so before opening realm (link), I wanted to check the state of user on realm app. User.state is defined of type enum UserState but the enum contains wrong values w.r.t what the state yields when the user is logged in. The enum contains value active whereas the value state yields is LoggedIn. This is showing eslint typescript errors so please fix it whenever possible or correct me if I am doing something wrong. Thank you! (Link to Enum)

Stacktrace & log output

None

Can you reproduce the bug?

Yes, always

Reproduction Steps

None

Version

10.20.0-beta.5

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

Android

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

@takameyer
Copy link
Contributor

@mk04366 Thanks for reporting this. You are completely correct. It appears there was a bit of an inconsistency developed between realm-web and realm with regard to the UserState.
The return values from realm are depicted here, which are different than those from realm-web. We will have to decide on which of these we want to converge on.
This would be a breaking change no matter which path we choose to go, since non-TS realm projects or realm-web projects would be effected. It may take some time for us to apply a fix, as this will require a major release. In the meantime, I would recommend applying a ts-ignore until we release a v12.

@mk04366
Copy link
Author

mk04366 commented Dec 28, 2022

@takameyer Sure! Thank you for confirming.

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