Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-1166

Unity: Compensating Write Errors not Logged as Errors

      What happened?

      When certain errors occur, such as compensating writes, the errrors are logged with Debug.Log instead of Debug.LogError or Debug.LogException (or the respective UnityLogger function) in Unity.

      This makes compensating writes difficult to spot.

      Repro steps

      1. Make Unity Project
      2. Write to an object that realm rules disallow this client to write to
      3. Observe - plain "Log" entries, even though the condition should be treated as an error log.

      Version

      12.1.0

      What Atlas Services are you using?

      Atlas Device Sync

      What type of application is this?

      Unity

      Client OS and version

      UnityEditor (Windows)

      Code snippets

      No response

      Stacktrace of the exception/crash you're getting

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      2024-07-09 08:17:08.264 Info: Connection[1]: Session[7]: Received: ERROR "Client attempted a write that is not allowed; it has been reverted" (error_code=231, is_fatal=false, error_action=Warning)
      UnityEngine.Debug:Log (object)
      UnityUtils.UnityLogger:LogImpl (Realms.Logging.LogLevel,string)
      Realms.Logging.Logger:Log (Realms.Logging.LogLevel,string)
      Realms.Logging.Logger:LogDefault (Realms.Logging.LogLevel,string)
      Realms.SharedRealmHandle:LogMessage (Realms.Native.StringValue,Realms.Logging.LogLevel)
      
      2024-07-09 08:17:08.376 Info: Connection[1]: Session[1]: Reporting compensating write for client version 221 in server version 44653: Client attempted a write that is not allowed; it has been reverted
      UnityEngine.Debug:Log (object)
      UnityUtils.UnityLogger:LogImpl (Realms.Logging.LogLevel,string)
      Realms.Logging.Logger:Log (Realms.Logging.LogLevel,string)
      Realms.Logging.Logger:LogDefault (Realms.Logging.LogLevel,string)
      Realms.SharedRealmHandle:LogMessage (Realms.Native.StringValue,Realms.Logging.LogLevel)
      

      ```

      Relevant log output

      No response

            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: