Skip to content

add proactive edit locking for issues - #1658

Open
MattBudz wants to merge 15 commits into
developfrom
editing-sessions/add-edit-locking-2
Open

add proactive edit locking for issues#1658
MattBudz wants to merge 15 commits into
developfrom
editing-sessions/add-edit-locking-2

Conversation

@MattBudz

Copy link
Copy Markdown
Contributor

Summary

Adds proactive edit locking for Issues: when a user opens the edit form for an issue that another user already has open, they see a lockout screen instead of the form, with the option to go back or edit anyway. This replaces the previous approach of only warning about conflicts after save.

Testing steps

  1. Log in to Dradis as a user with author access to a project, in Browser A.
  2. Navigate to a project and open the Issues section.
  3. Create a new issue (or use an existing one) and note its title.
  4. Open a second, separate browser (or a private/incognito window) as Browser B, and log in as a different user.
  5. In Browser A, click Edit on the issue.
  6. Assert Browser A loads the normal "Edit issue" form.
  7. In Browser B, navigate to the same issue and click Edit.
  8. Assert Browser B shows a "This issue is currently being edited" lockout screen instead of the edit form.
  9. Assert the lockout screen displays the name of the user editing in Browser A.
  10. In Browser B, click Go back.
  11. Assert Browser B returns to the issue's show page (not the edit form).
  12. In Browser B, click Edit again, then click Edit anyway on the lockout screen.
  13. Assert Browser B now shows the edit form for the issue.
  14. In Browser A, make a change to the issue text and click Update Issue.
  15. Assert Browser A shows the "Issue updated." confirmation and the change is saved.
  16. In a new browser tab, log in as the Browser A user and click Edit on the same issue.
  17. Assert the edit form loads normally (the lock was released after Browser A's save, so no lockout screen appears).
  18. Wait for more than 24 hours since a session was acquired (or, in a test/staging environment, adjust the system clock forward), then have a new user attempt to edit a previously-locked record.
  19. Assert the edit form loads normally (a stale lock older than 24 hours no longer blocks editing).

Check List

  • Added a CHANGELOG entry
  • Commit message has a detailed description of what changed and why.

MattBudz added 5 commits July 22, 2026 11:29
qa/_state_button.html.erb opened .btn-group but never closed it,
relying on the caller to supply the closing tag. This happened to
work by coincidence as long as the caller's own div count matched,
but breaks non-browser HTML parsers (and any caller with a different
div count) since the tag is genuinely unbalanced.
Comment thread db/migrate/20260722100000_create_editing_sessions.rb Outdated
Comment thread app/models/editing_session.rb
Comment thread app/models/editing_session.rb Outdated
MattBudz and others added 9 commits July 24, 2026 18:19
qa/_state_button.html.erb now closes its own .btn-group div, which
exposed a stray closing div at the end of the form partial that used
to cancel it out. The mismatch made the browser relocate the <form>
element during HTML parsing, collapsing the two-column edit layout.
Nest the Cancel link inside .form-actions.sticky and close it once.
c1a3654 included db/development.sqlite3, db/test.sqlite3, and
db/production.sqlite3 via a broad git add. The development database
carries a Configuration row with an absolute path under /Users/aaron,
which breaks db:rollback/db:migrate on any other machine. Ignore
db/*.sqlite3* going forward so this doesn't happen again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants