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

Realm Corruption Following Client Resets Due to Permission/Role Changes on Server #8559

Closed
divan84 opened this issue Apr 24, 2024 · 5 comments

Comments

@divan84
Copy link

divan84 commented Apr 24, 2024

How frequently does the bug occur?

Sometimes

Description

We are experiencing corruptions of Realm databases following client resets triggered by permission/role changes on the server. This issue is not reliably reproducible, and unfortunately, we do not have logs to provide more insight. We only have the incorrect Realm files, which we have examined using Realm Studio.

It is suspected that this issue may arise when the client undergoes multiple client resets in quick succession.

It appears there may be flaws in the client reset logic that need to be addressed!

Stacktrace & log output

No response

Can you reproduce the bug?

No

Reproduction Steps

Roughly speaking, our scenario is as follows

  • We manage SyncPermissions via CustomUser data. Any change in this data typically triggers a client reset.
  • We handle projects. When a project is added, a Server-Trigger adds a Managed-Team object to the project. This change also modificats our Permission-Properties to the CustomUser data.
  • A client reset occurs, and usually, everything on the client side appears as it should. However, when a project is deleted, another trigger modifies the CustomUser data changing permissions again, leading to another client reset.

Due to the above workflow, situations may arise where multiple client resets occur in quick succession due to permission/role changes on the server.

However, in some cases, the following issues have been observed:

  • The ManagedTeam object, which should be added to the Project object by the server trigger, is missing after the client reset.
  • Lists containing the Project object, or Lists that are included in the project, display incorrect behavior: contents appear duplicated and incorrectly structured (In Realm Studio the List-Elements are duplicated but share the same index(!)) When the Realm is opened in Realm Studio, it seems that identical objects appear duplicated. (Screenshot from RealmStudio attached)
Realm-Studio1 Realm-Studio2 Realm-Studio3

Version

<= 10.49.1

What Atlas Services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

macOS

Build environment

Xcode version: ...
Dependency manager and version: ...

Copy link

sync-by-unito bot commented Apr 24, 2024

➤ PM Bot commented:

Jira ticket: RCOCOA-2342

@Jaycyn
Copy link

Jaycyn commented May 1, 2024

That's certainly an odd issue. Two questions

When you examine the data on the server using the Console, is it also duplicated?

Have you examined the data with something other than Realm Studio? e.g. craft up a quick app to read in the local data and output to console? Then compare that to what's shown in Realm Studio. It would eliminate something funky going on with Realm Studio (which I doubt)

@divan84
Copy link
Author

divan84 commented May 1, 2024

The problem was also synced and could therefore also be seen on the server.

We also saw the problems in our Realm Swift App - that's when we realized that something must be wrong.

@nirinchev
Copy link
Member

Hey @divan84, since this is a sync issue that may require that the team investigates the sync history as well as analyze the server logs, can you please file a support ticket here: http://support.mongodb.com/? The realm-swift repo is primarily used to track bugs with the Realm Swift SDK and engineers working on this project don't have the access necessary to debug server-side problems.

@nirinchev nirinchev self-assigned this May 1, 2024
@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label May 1, 2024
@divan84
Copy link
Author

divan84 commented May 2, 2024

We will contact the support! Thanks!

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels May 2, 2024
@nirinchev nirinchev closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label May 2, 2024
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