You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Especially when connections are slow, but even on localhost, the model is not fast enough to send the data to the backend, when the model saving method is called shortly after the last keypress. See this example:
When you run that component, write a longer string like "sdhfkjhdsfkjhkjdsf" and quickly press Enter, the saved model's name field will only contain approximately "sdhfkjhds".
I want to use unicorn for "inline" editing - a <input> replaces the text when in edit_mode and is saved automatically if in any of the input fields the user presses Enter. A quick and responsive UI is important, and data loss is very bad, in any case.
The text was updated successfully, but these errors were encountered:
nerdoc
changed the title
unicorn:model looses data
possible race condition: unicorn:model looses data when saved too quickly.
Mar 22, 2024
nerdoc
changed the title
possible race condition: unicorn:model looses data when saved too quickly.
possible race condition: unicorn:model looses data when saved too quickly.
Mar 22, 2024
My hypothesis has been that multiple requests are getting sent and come back from the server in a different order, so forcing requests into a queue was my attempt to solve for this. Have you tried enabling serial?
I have always felt like there should be a more elegant solution in the JavaScript of unicorn (maybe an event bus or something?), but replicating this and building a test suite which ensures everything works as expected has been a challenge, unfortunately.
Especially when connections are slow, but even on localhost, the model is not fast enough to send the data to the backend, when the model saving method is called shortly after the last keypress. See this example:
When you run that component, write a longer string like "sdhfkjhdsfkjhkjdsf" and quickly press Enter, the saved model's name field will only contain approximately "sdhfkjhds".
I want to use unicorn for "inline" editing - a
<input>
replaces the text when inedit_mode
and is saved automatically if in any of the input fields the user presses Enter. A quick and responsive UI is important, and data loss is very bad, in any case.The text was updated successfully, but these errors were encountered: