realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.72k stars 564 forks source link

useObject and reinsertion item #6687

Open astrahov opened 3 months ago

astrahov commented 3 months ago

How frequently does the bug occur?

Always

Description

When deleting and recreating an object, the deletion is handled properly and the object becomes null. However after reinsertion it stays null.

The temporary fix of @mordechaim worked: https://github.com/realm/realm-js/issues/4514#issuecomment-1117666924

// replace this
const cat = useObject('Cat', 'id-1')

// with
const cat = useQuery('Cat').filtered('id == $0', 'id-1')[0]

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

12.9.0

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 17.5

Build environment

{
  "dependencies": {
    "react": "18.2.0",
    "react-native": "0.74.1",
    "realm": "12.9.0",
  },
}

Cocoapods version

1.14.3

sync-by-unito[bot] commented 3 months ago

➤ PM Bot commented:

Jira ticket: RJS-2826

danibonilha commented 2 months ago

Facing the same issue