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

Use sync error domain errors from network client #4580

Merged
merged 7 commits into from
Feb 20, 2017
Merged

Conversation

stel
Copy link
Contributor

@stel stel commented Jan 24, 2017

Network client handles some sync-related (e.g. authentication) errors that should be reported by SyncManager directly.

Note that currently ROS never reports RLMSyncAuthErrorUserAlreadyExists, RLMSyncAuthErrorUserDoesNotExist codes and I'm not sure if that's changed. So probably this codes should be removed and InvalidCredentials could be moved to RLMSyncError enum.

@austinzheng, @jpsim let me know what you think.

Copy link
Contributor

@austinzheng austinzheng 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 making this fix.

Copy link
Contributor

@jpsim jpsim left a comment

Choose a reason for hiding this comment

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

Unfortunately, we can't rename RLMSyncAuthErrorInvalidCredential to RLMSyncAuthErrorInvalidCredentials, despite it being correct, because the sync APIs are now out of beta and so we're sticking to SemVer for them, and renaming this would break the public API.

@stel
Copy link
Contributor Author

stel commented Jan 30, 2017

Sorry for a delay on this. I've updated the PR and added a corresponding test to check the reported error domain.

@jpsim
Copy link
Contributor

jpsim commented Feb 15, 2017

Note that currently ROS never reports RLMSyncAuthErrorUserAlreadyExists, RLMSyncAuthErrorUserDoesNotExist codes and I'm not sure if that's changed. So probably this codes should be removed and InvalidCredentials could be moved to RLMSyncError enum.

I don't know if this comment is still accurate after your latest changes, but that's not quite right, as "user already exists" could be reported if the current user is an admin.

@stel
Copy link
Contributor Author

stel commented Feb 16, 2017

It doesn't look like "user already exists" can be reported in any cases at all anymore (@mrackwitz please correct me if I'm wrong) while "user doesn't exists" can be reported when working with permissions, so it's not really a "SyncDomain" error.

I think if nothing is planned to be changed back on a server-side we should deprecate RLMSyncAuthErrorUserAlreadyExists and RLMSyncAuthErrorUserDoesNotExist.

@stel stel merged commit 5a89982 into master Feb 20, 2017
@stel stel deleted the do-sync-error-codes branch February 20, 2017 08:42
@stel stel removed the S:Review label Feb 20, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants