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

   ### SUMMARY
   Fixes the SQL Lab query history pane becoming empty after running a query in 
a new tab from Query History.
   
   When a new SQL Lab tab is created locally and then persisted to the backend, 
the editor id changes from the temporary local id to the backend tab id. 
`syncQueryEditor` only migrated queries that were marked as `inLocalStorage`, 
so a just-started query from an autorun cloned tab could stay attached to the 
old local editor id. The Query History pane then filtered by the backend tab id 
and no longer found the query.
   
   This updates tab sync to migrate all non-preview queries attached to the 
local editor id, and adds regression coverage for a running query that is not 
marked `inLocalStorage`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A. Behavior-only SQL Lab state fix.
   
   ### TESTING INSTRUCTIONS
   1. Enable SQL Lab backend persistence.
   2. Open SQL > Query History.
   3. Click Run query in a new tab for an existing query.
   4. Confirm the new SQL Lab tab keeps showing the query in the Query History 
pane after the tab is saved to the backend.
   
   Automated/local checks run:
   - `npm run test -- src/SqlLab/actions/sqlLab.test.ts --runTestsByPath`
   - `npm run lint -- src/SqlLab/actions/sqlLab.ts 
src/SqlLab/actions/sqlLab.test.ts`
   - `pre-commit run --files superset-frontend/src/SqlLab/actions/sqlLab.ts 
superset-frontend/src/SqlLab/actions/sqlLab.test.ts`
   - `git diff --check`
   
   Note: `pre-commit run --all-files` was run before pushing, but this local 
worktree did not complete green because of unrelated baseline/environment 
blockers outside this diff, including existing mypy/ruff failures in unrelated 
Python files and missing local all-files tooling/build prerequisites (`yarn`, 
`helm-docs`, and package build artifacts before local package build).
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue: Shortcut SC-105345 / PPR-1271
   - [x] Required feature flags: `SQLLAB_BACKEND_PERSISTENCE`
   - [x] 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