Closed xxKRASHxx closed 6 years ago
Observe changes and make side effects on a ROS
Change Realm Object property
Error: Cannot modify managed objects outside of a write transaction. at Realm.change.realm.write
Subscribe on change event in ROS and try make changes on changed object.
observe(change: Realm.Sync.ChangeEvent) { let perform = (change: Realm.Sync.ChangeEvent, changed: Movie) => { try { change.realm.write(() => { changed.status = 'processing' }) } catch (e) { console.log("Error on creation" + e) } } let allMovies = change.realm.objects('Movie') as Realm.Results<Movie> perform(change, allMovies[0]) }
moving this to realm-cocoa since it is an SDK issue not the server
realm-cocoa
Issue moved to realm/realm-cocoa #5453 via ZenHub
Goals
Observe changes and make side effects on a ROS
Expected Results
Change Realm Object property
Actual Results
Error: Cannot modify managed objects outside of a write transaction. at Realm.change.realm.write
Steps to Reproduce
Subscribe on change event in ROS and try make changes on changed object.
Code Sample
Version of Realm and Tooling