Skip to content

Conversation

@Tim020
Copy link
Contributor

@Tim020 Tim020 commented Jan 6, 2026

Summary

  • Fixed 8 HTTP DELETE endpoints that incorrectly used request body instead of query parameters
  • Updated 9 frontend DELETE API calls to use URLSearchParams for query parameter construction
  • Added explicit type validation with proper error handling for invalid IDs

Changes

Backend (6 files, 8 DELETE methods)

Controllers updated:

  • acts.py - DELETE endpoint now uses query parameter
  • cast.py - DELETE endpoint now uses query parameter
  • characters.py - Both DELETE endpoints (Character and CharacterGroup) now use query parameters
  • cues.py - Both DELETE endpoints (CueType and Cue) now use query parameters
    • Cue DELETE handles multi-parameter case (cueId + lineId)
  • microphones.py - DELETE endpoint now uses query parameter
  • scenes.py - DELETE endpoint now uses query parameter

Implementation:

  • Changed from escape.json_decode(self.request.body) to self.get_argument("id", None)
  • Added explicit int() conversion with try/except blocks
  • Returns 400 error with "Invalid ID" message for non-numeric IDs

Frontend (2 files, 9 DELETE calls)

Files updated:

  • show.js - 7 DELETE API calls
  • script.js - 2 DELETE API calls (including multi-parameter DELETE_CUE)

Implementation:

  • Uses URLSearchParams for query parameter construction
  • Follows existing pattern from DELETE_SCRIPT_REVISION
  • Removes request body from DELETE requests

Why This Matters

Testing

  • ✅ All 200 tests passing
  • ✅ No regressions detected
  • ✅ Existing DELETE tests already used query parameters

Deployment Notes

This is a breaking change - old clients will receive 400 errors when attempting DELETE operations.

  • Deploy backend and frontend together in coordinated release
  • Document in release notes/CHANGELOG

🤖 Generated with Claude Code

…body (Issue #809)

Updated DELETE endpoints to follow HTTP best practices by using query parameters
instead of request bodies. This fixes compatibility issues with HTTP clients and
proxies that may strip bodies from DELETE requests.

Backend changes:
- Updated 8 DELETE methods across 6 controllers to use self.get_argument()
- Added explicit int() conversion with try/except for proper error handling
- Returns 400 error for invalid (non-numeric) IDs

Frontend changes:
- Updated 9 DELETE API calls to use URLSearchParams
- Follows existing pattern from DELETE_SCRIPT_REVISION

All 200 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added client Pull requests changing front end code server Pull requests changing back end code medium-diff labels Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Python Test Results

  1 files    1 suites   17s ⏱️
220 tests 220 ✅ 0 💤 0 ❌
225 runs  225 ✅ 0 💤 0 ❌

Results for commit 9fe905a.

♻️ This comment has been updated with latest results.

@Tim020 Tim020 changed the title Fix HTTP DELETE endpoints to use query parameters (Issue #809) Fix HTTP DELETE endpoints to use query parameters Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Client Test Results

34 tests   34 ✅  0s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 9fe905a.

♻️ This comment has been updated with latest results.

@Tim020 Tim020 changed the base branch from main to dev January 6, 2026 02:05
@Tim020 Tim020 enabled auto-merge (squash) January 6, 2026 02:06
@Tim020 Tim020 merged commit 7caa0af into dev Jan 6, 2026
14 checks passed
@Tim020 Tim020 deleted the issue/809 branch January 6, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Pull requests changing front end code medium-diff server Pull requests changing back end code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-standard HTTP: DELETE endpoints use request body instead of query params

2 participants