surrealdb / surrealist

Surrealist is the ultimate way to visually manage your SurrealDB database
https://surrealist.app/
MIT License
1.06k stars 81 forks source link

Editing records on the Explorer tab overwrites futures #190

Open DavidCZ2051 opened 5 months ago

DavidCZ2051 commented 5 months ago

Describe the bug Editing a record using the Inspector on the Explorer tab overwrites futures. I have a user record with a birthdate field of type birthdate and an age field of type future {duration::years(time::now() - birthdate)}. When I edit any field on the user record, the age field gets overwritten by the displayed value from the JSON ({duration::years(time::now() - birthdate)} => 18). I can get around this by just editing the record using a query but at first, I found it confusing why my futures aren't working.

To Reproduce Steps to reproduce the behavior:

  1. Make a record with a future field
  2. Edit any field on the record using the Inspector on the Explorer tab

Expected behavior Future fields should not get overwritten by the display value in the JSON. I assume the whole JSON is being sent to the database when editing a record, one way the bug can be fixed is to send only the JSON fields that got changed in the Inspector.

Environment (you can view the current version under Settings):