zyratlo opened a new pull request, #7791:
URL: https://github.com/apache/texera/pull/7791

   ### What changes were proposed in this PR?
   This PR resolves the real version ID of a workflow instead of the constant, 
and makes the fetch version-agnostic so a mapping keeps reattaching after the 
workflow's version advances. `notebook.wid` is UNIQUE (one notebook per 
workflow) and the fetch join is on `wid + nid`, so keying on `wid` alone is 
sufficient and correct.
   
   **`NotebookMigrationResource` (store resolves the version, fetch drops the 
vid filter)**
   - Store no longer reads a vid from the request. It resolves the mapping's 
vid server-side as `MAX(workflow_version.vid)` for the wid, anchoring the 
mapping to the workflow's own latest version rather than a client-supplied 
value. If the workflow has no version to anchor to, it returns a 400 before any 
insert instead of a 500 from the FK.
   - Fetch no longer reads a vid or filters the query by it, so the stored 
mapping still resolves after the workflow advances to a newer version.
   - Adds a future-work note at the fetch query: supporting one notebook per 
workflow version would mean dropping the `notebook.wid` UNIQUE constraint and 
re-adding a vid filter (falling back to the latest), since without it a 
multi-notebook workflow would silently return only the newest.
   
   **`NotebookMigrationService` (frontend store)**
   - `storeNotebookAndMapping` drops its `vid` parameter and stops sending 
`vid` in the request body. The version is now resolved by the backend.
   
   **`JupyterPanelService` (frontend fetch)**
   - `fetchNotebookAndMapping` drops its `vId` parameter and the `vid` field 
from the request body, along with the stale "Future work: add dynamic fetching 
of current workflow vId" comment. The panel reattaches by wid.
   
   ### Any related issues, documentation, discussions?
   Closes #7636
   Parent issue #4301
   
   ### How was this PR tested?
   Added tests in 
   - `NotebookMigrationResourceSpec.scala`
   - `notebook-migration.service.spec.ts`
   - `jupyter-panel.service.spec.ts`
   
   Also manually verified on local development environment.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   Generated-by: Claude Code (Claude Opus 4.8)


-- 
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]

Reply via email to