massucattoj opened a new pull request, #40833:
URL: https://github.com/apache/superset/pull/40833

   ### SUMMARY
   
   Double-clicking the **+ Dashboard** button on the Dashboards page caused 
Superset to create two (or more) duplicate dashboards. Each click fired 
`navigateTo('/dashboard/new', { assign: true })`, which calls
   `window.location.assign(...)`. With a real OS-level double-click (~50–300ms 
gap between events), both `assign` calls reach the browser before the page 
tears down, so the backend `Dashboard.new()` route receives
   two GETs and commits two `DashboardModel` rows.
   
   This PR adds a small module-level dedupe inside `navigateTo`: when `assign: 
true` is used, repeated calls to the same URL within the same page session 
become no-ops. The guard naturally resets when the page
   unloads after a successful navigation.
   
   The fix is centralized at the util level, so the same protection also 
applies to the **+ Chart** button on the Welcome page (`/chart/add`), which has 
the same potential for duplicates.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <img width="1710" height="422" alt="Screenshot 2026-06-06 at 16 02 35" 
src="https://github.com/user-attachments/assets/91f6c7ff-d697-4818-bdca-eeed78c4726d";
 />
   - Before
   <img width="1712" height="632" alt="Screenshot 2026-06-06 at 16 05 09" 
src="https://github.com/user-attachments/assets/18f0ef03-8bf3-4a59-bca5-88f6af8c713d";
 />
   
   - After
   <img width="1711" height="435" alt="Screenshot 2026-06-06 at 16 02 58" 
src="https://github.com/user-attachments/assets/c1aad762-8863-4ebb-b0fb-7a4c5432d6d7";
 />
   
   <!--- Skip this if not applicable --
   
   ### TESTING INSTRUCTIONS
   1. Open Superset → Dashboards.
   2. Double-click the **+ Dashboard** button quickly.
   3. Return to the Dashboards list and confirm only **one** new dashboard was 
created.
   4. Repeat for Charts: Welcome page → double-click **+ Chart** → only one 
chart-create flow opens.
   5. Sanity-check normal navigation still works (single click on **+ 
Dashboard** creates one dashboard as expected; navigating to different URLs in 
sequence still works).
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to