Skip to content

[bug:gsoc26] Mass command wizards started in two browser tabs overwrite each other #1489

Description

@dee077

Describe the bug
The mass command wizard keeps its state in a single session slot, so starting a second mass command in another browser tab replaces the first one. The first tab can no longer execute its mass command, and reloading it shows the details entered in the second tab.

Steps To Reproduce

  1. In tab A, open Network Operations > Mass command execute, fill in the form (for example type Reboot) and click Review command
  2. In tab B, open Mass command execute, fill in the form with different values (for example type Custom commands) and click Review command
  3. Go back to tab A without reloading it and click Execute
  4. The mass command is not executed and the user is sent back to the first step with: "This mass command was replaced by another one started in a different browser tab, so it was not executed. Please fill in the details again."
  5. Reloading the review page in tab A shows the details entered in tab B

Expected behavior
Each tab keeps its own mass command: tab A reviews and executes what was entered in tab A, tab B what was entered in tab B.

Possible fix
The session stores one wizard under batch_command_wizard, and the review page URL is the same for every wizard, so a request cannot say which wizard it belongs to. Store the wizards in the session as a dictionary keyed by a stable wizard id, keeping only the most recent ones. The existing token, which changes when the targeted devices change, stays inside each wizard.

System Informatioon:

  • OS: Ubuntu 26.04 LTS
  • Python Version: Python 3.12.13
  • Django Version: Django 5.2.17

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions