Uploaded image for project: 'Realm Cocoa SDK'
  1. Realm Cocoa SDK
  2. RCOCOA-2342

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

      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)



      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: ...

            Assignee:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: