Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

Prevent erros when the relation was deleted (with observers) #1719

Open rafwell opened 11 months ago

rafwell commented 11 months ago

Hi!

How can I prevent and error when my relation was deleted from server database? Look this scenarius:

  1. I have a post with author, who is deleted
  2. I do the first sync, they pull the posts table and authors, but only the not soft deleted rows
  3. I make a component with observer the post and the post.author, but they say me and the render fails: Diagnostic error: Record authors#e562d440-9076-11ee-8a3b-0bc90c8fac9a not found

I want show the deleted relation, to show the name of author, or some another way who not cause render fail, like an null coalescing approach

suman379 commented 10 months ago

you can use experimentalFailSafe to prevent this error.