datatracker icon indicating copy to clipboard operation
datatracker copied to clipboard

User may be sent to incorrect doc after editing ballot position when using multiple tabs/windows

Open jennifer-richards opened this issue 1 year ago • 2 comments

Describe the issue

If a user is reviewing / editing ballots for two or more documents in different browser tabs or windows they may be taken to the wrong document after saving a ballot position.

To reproduce:

  1. Log in to a dev instance/sandbox as an AD and navigate to /iesg/discusses/
  2. Duplicate the browser tab. Call the original tab A and the new tab B.
  3. In tab A, click on the first document's name (leftmost column) then select the "IESG evaluation record" tab
  4. Switch to tab B. click on the second document's name then select the "IESG evaluation record" tab
  5. Switch back to tab A and click the "Edit position" button near the top. Click "Save"
  6. Notice that you're now at the "IESG evaluation record" page for the document in tab B, not the one that was in tab A

The problem is that the views_doc.document_ballot() view puts its URL in the session as ballot_edit_return_point and the views_ballot.edit_position() view uses this value (when available) to set the return URL. When multiple tabs / windows are in use, these can get out of sync.

Need to straighten this out. Keep in mind that this mechanism is used to allow the ballot edit view to return to different places depending on how it was reached. It is accessed at least from the document_ballot() view and the IESG agenda's view. Searching for places that ballot_edit_return_point is set in the session should identify the places it might need to return to.

Code of Conduct

jennifer-richards avatar Apr 03 '24 15:04 jennifer-richards

As a workaround: If you reload the page in the browser immediately before clicking the "Edit position" button each time then this bug should not occur. I.e., reload before clicking the button in step 5 of the instructions above.

jennifer-richards avatar Apr 03 '24 17:04 jennifer-richards

views_doc.document_ballot()Ariel rojas

Luis900927 avatar Apr 06 '24 23:04 Luis900927