Errors when editing an issue that was just edited - StaleObjectError
What should happen¶
- User A opens issue #100 and starts to update it with content and files
- User B opens issues #100, changes the status, and saves
- User A submits the form
- Images are uploaded
- Redmine finds User A's data was stale
- Redmine redirect User A to the edit form with the data User A has seen but without a stale lock
- Redmine displays User A's comment and time entry data properly in the form
- Redmine displays an Error message saying the data was updated by another user
- User A checks the form and resubmits
- Redmine saves User A's data
8. The error should say which data was updated. Since User B changed the Status it should say "Status was changed to XYZ"
9. Re-submitting the form fails because Redmine is using the stale lock and not a fresh one. Since the lock is never renewed, the user will be unable to submit the form successfully.
I have working code and will integrate it once it's been tested and cleaned up
#3 Updated by Eric Davis about 11 years ago
Jean-Philippe Lang wrote:
It prevents user B from overwriting user A's changes by simply re-submitting the form.
Surely, it's a poor design but it's not a defect.
It puts the user into a position where they either lose their data or have to copy and paste it all into a new browser tab, hence the defect. If you look the form when there is a conflict, there is a hidden field for lock_version that is the stale lock. So at that point, the user cannot ever submit the form, even if they reconcile the differences. If the error is going to be handled by displaying a form, then the form should be functional.
#4 Updated by Eric Davis over 10 years ago
- File stale-error-messages.png added
- Target version set to 0.9.0
- % Done changed from 50 to 0
I've attached a patch to fix thi, I've ran into it many times and every time I lose data. This patch fixes several things and makes the user interface more friendly (I hope):
- When a conflict occurs, the user can submit their change
- The conflicting fields are shown to the user (in Red)
- File attachments that failed are saved and re-associated (this reverts the fix in r2875 / #3846. If the user just spent a bunch of time to upload a large file, deleting it could make them unhappy).
I'm ready to commit this fix if it looks good.
Here's a screenshot of what the user would see if a conflict occurred.