Commit Graph
6 Commits
Author SHA1 Message Date
DottaandClaude Opus 4.8 9c65ebfcf8 Harden application delete against concurrent connection creation (PAP-10824)
DELETE /tool-applications/:applicationId pre-checked for connections and
then deleted in a later statement. Because tool_connections.application_id
was ON DELETE CASCADE, a connection created in that gap was silently
cascade-deleted instead of forcing the promised 409.

Switch the FK to ON DELETE NO ACTION so the database fails closed: an
application with connections can never be deleted, and a concurrently
inserted connection (which takes a FOR KEY SHARE lock on the parent row)
forces the delete to raise a foreign_key_violation rather than cascade.
NO ACTION (end-of-statement check) rather than RESTRICT (immediate) keeps
company teardown cascading cleanly.

The service still pre-checks for a friendly 409 with connectionCount, and
now also translates a 23503 violation on the connection FK into the same
409 so the race surfaces the conflict instead of a 500.

Regression tests: the raw delete is rejected and both rows survive (the
old cascade would have silently dropped the connection), and a company
delete still cascades application + connection away.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 16:26:29 +00:00
DottaandClaude Opus 4.8 6f2490afbe Add guarded application delete (Phase 4, PAP-10817)
DELETE /tool-applications/:applicationId with board-only auth + company
check mirroring the PATCH route. Guards with 409 when the application
still has connections (no force-cascade in v1) and writes a
tool_application.deleted activity log entry. Adds deleteApplication to
the UI client and a destructive confirm dialog in the row actions menu
that surfaces the connection-guard guidance inline on 409.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 16:06:01 +00:00
DottaandPaperclip a446a67850 Fix duplicate tool application rename conflict
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-10 15:57:05 +00:00
Dotta fb4d7cf221 Add application edit actions 2026-06-10 15:36:42 +00:00
DottaandPaperclip e9cb8e2b28 chore: update MCP access branch onto master (PAP-10797)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-10 12:52:57 +00:00
DottaandPaperclip b35397286f Implement governed MCP tool access
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-10 12:49:01 +00:00