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

Wrong handling of Sync error codes #6978

Closed
cmelchior opened this issue Sep 15, 2023 · 1 comment · Fixed by #7002
Closed

Wrong handling of Sync error codes #6978

cmelchior opened this issue Sep 15, 2023 · 1 comment · Fixed by #7002
Assignees

Comments

@cmelchior
Copy link
Contributor

Kotlin has an asymmetric test that fails on the latest BAAS commit 3e370f9ee73c00efe2486ce5cd91d8fceb841cd6. I'm still looking into why, but the returned error is crashing Core:

We are getting this back from the server:

json_error 230 495 6
{"message":"Client attempted a write that is outside of permissions or query filters","isRecoveryModeDisabled":false,"tryAgain":false,"logURL":"http://localhost:9090/groups/6503237182ce974ccb7d7b84/apps/6503259382ce974ccb7d7b92/logs?co_id=6503f28e82ce974ccb7e8e98","shouldClientReset":false,"action":"Warning","rejectedClientVersion":11,"rejectedUpdates":[{"table":"AsymmetricA","pk":"CmUD8oZK+IlKoE2w5A==","reason":"write to \"6503f2864af8894aa04db0e4\" in table \"AsymmetricA\" not allowed"}]}.

This type of error is crashing Core here: https://github.com/realm/realm-core/blob/master/src/realm/sync/noinst/protocol_codec.hpp#L307

According to the Sync team, this compensatingWriteServerVersion field is apparently optional, so I'm not 100% sure how you want to handle this. See https://mongodb.slack.com/archives/G0121N9LJ14/p1694694357742649?thread_ts=1694682200.728329&cid=G0121N9LJ14

@sync-by-unito
Copy link

sync-by-unito bot commented Sep 25, 2023

➤ michael-wb commented:

From Kiro in the Slack thread:

for illegal asymmetric writes, error code 230 will be returned with an attached rejectedClientVersion and rejectedUpdates , but no compensatingWriteServerVersion because it does not generate a compensating write. it just drops the asymmetric object; compensatingWriteServerVersion is only included with error code 231

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 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 a pull request may close this issue.

2 participants