Traffic Cop improvements #3502
Replies: 5 comments
-
updated_at suggestion covers some of the use cases, fields with deletable file/image can trigger model hashing suggestion only works with the assumption that each field will correspond with a specific modal attribute and there no mutation happening either via |
Beta Was this translation helpful? Give feedback.
-
Isn't there another reliable timestamp on the server which can be used? Something from the ActionResource/ActionEvent that keeps track of mutations perhaps?
Agreed, hashing isn't an option. The whole point is that you can't match a client-side timestamp with a server-side timestamp, because that's comparing apples with oranges. We somehow need an apple from the server-side to do the comparison later on or this feature is fundamentally buggy. |
Beta Was this translation helpful? Give feedback.
-
Over-complicated and can potentially cause more unexpected results, and it would be harder to debug.
It is working only in certain criteria, buggy to others. I wish we can have another way of preventing overriding already replaced value instead of completely abandoning local change if a model has been updated by someone else. But for now, the suggestions only cover some and not all scenarios, and possible to create another fundamentally buggy feature. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if it is a good solution or not. Can we send the latest timestamp (may be time()) from the server to the client with the response and then initialize the lastRetrievedAt in Vue with that timestamp. |
Beta Was this translation helpful? Give feedback.
-
It just happened to me on Nova 4.19 & Laravel 9.19 with a user having a slightly incorrect time on his computer. @crynobone I don't know how it works internally, but the suggestion from @mohitYogi seems good. Or store the time offset between the client and the server on client-side to do the math if needed. |
Beta Was this translation helpful? Give feedback.
-
Description:
I'm experiencing a bug with the traffic cop feature that has been reported multiple times. Using
Update & Continue Editing
on a resource I frequently get theAnother user has updated this resource since this page was loaded
error message even-though I'm the only user (this is reproducible in my local setup).This proposed solution seems like a structural fix. Is anything being done with that?
Related issues
Beta Was this translation helpful? Give feedback.
All reactions