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

   ### What changes were proposed in this PR?
   
   Selecting several workflows and clicking **Delete selected** goes wrong when 
one of them is shared with you. The server deletes the workflows listed before 
the shared one, skips the rest, and still replies 204. The page then removes 
every selected row.
   
   - **Server, `WorkflowResource.deleteWorkflow`:**
     - It checks that the user owns every workflow before deleting any. If not, 
it returns 403 and nothing is deleted.
     - The deletes run on the transaction's connection, so they all commit or 
roll back together.
     - The `BadRequestException` that was silently swallowed is gone.
   - **Page, `handleConfirmDeleteSelectedWorkflows`:**
     - Only the owned workflows are sent.
     - Shared workflows stay in the list, with a warning that only the owner 
can delete them.
     - Notebook cleanup runs only for the workflows that were actually deleted.
   
   ### Any related issues, documentation, discussions?
   
   Closes #9434
   
   ### How was this PR tested?
   
   - `WorkflowResourceSpec`:
     - New test: a selection with a shared workflow throws `ForbiddenException` 
and deletes nothing.
     - New test: several owned workflows are deleted in one request.
     - The spec's cleanup step now deletes only each user's own workflows.
   - `user-workflow.component.spec.ts`:
     - New test: only owned workflows are sent and the shared row stays.
     - New test: no request is sent when every selected workflow is shared.
   - Without the fix, the new tests fail: one on the server, two on the page.
   - Checked by hand on a local server:
   
   ```
   POST /api/workflow/delete {"wids":[40,41,42]}   40, 42 = mine, 41 = shared 
with me (Write)
   HTTP 403   → 40, 41, 42 all still exist
   POST /api/workflow/delete {"wids":[40,42]}
   HTTP 204   → only 41 remains
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


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