Uploaded image for project: 'Realm Java SDK'
  1. Realm Java SDK
  2. RJAVA-1222

At times, Realm proxy objects stop providing their data

      How frequently does the bug occur?

      Sometimes

      Description

      I apologize for the flaky description, but I haven't been able to get a firm grasp on the situation yet.

      Essentially, ever since a few weeks ago, our Android development environment sometimes reaches a state wherein proxy objects returned from Realm queries stop returning their data to the caller, causing weird behaviors to emerge throughout the app that feel like bugs on our end, but aren't. The toString() representation of the proxy objects include all the data, but when reading any of the properties off the proxy, type-dependent empty data (e.g. 0 or "") is returned. Attached is a screenshot of the debugger output – despite the partial obfuscation, the discrepancy between the top line and the properties should be visible.

      When this state happens, clearing the build folder of the affected Gradle module and rebuilding from a clean slate resolves the problem for a while. This causes me to think that it is related to incremental builds, but I'm not sure. In the compilation right before the issue happens, we see the transformer's logs like normal, so it doesn't seem like anything is skipped there.

      Another note is that the project is also using AGP 8+ and Gradle 8+, so maybe there is some form of missing support here still?

      Any insight is appreciated!

      > [!NOTE]
      > Since turning off incremental compilation via io.realm.disableIncrementalBuilds = true, I haven't seen the issue creep up again. I will let y'all know if this changes, however.

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      No

      Reproduction Steps

      No response

      Version

      10.16.1

      What Atlas App Services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      macOS Ventura 13.4

      Build environment

      Android Studio version: 2023.1.1 Canary 15 (Build #AI-231.9225.16.2311.10572941, built on July 28, 2023)
      Android Build Tools version: 34.0.0
      Android Gradle Plugin version: 8.1.0
      Gradle version: 8.2.1

            Assignee:
            clemente.tort@mongodb.com Clemente Tort Barbero
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: