Skip to content

fix: delete endpoint bugs + add comments - #1123

Merged
sebiboga merged 1 commit into
masterfrom
fix/delete-null-payload
Jul 28, 2026
Merged

fix: delete endpoint bugs + add comments#1123
sebiboga merged 1 commit into
masterfrom
fix/delete-null-payload

Conversation

@sebiboga

Copy link
Copy Markdown
Member

Fixes multiple bugs in /v1/scraper/jobs/delete/ (merged empty in #1120):

Bug fixes:

  • Count query used postJson() with null/empty body → Solr rejects POST with empty body to /select. Changed to getJson() (GET with URL params)
  • Removed dead $countPayload code (built but never used)
  • Added Solr response status check after delete (previously silently returned success on failure)

Improvements:

  • Added getJson() helper for GET requests (matches pattern in jobs/index.php)
  • Extracted solrEscape() as reusable function (was inline)
  • Added step-by-step comments throughout the file
  • Added file-level docblock explaining accepted input format

- Count query now uses GET (Solr rejects POST with empty body)
- Added getJson() helper for GET requests to Solr
- Removed dead $countPayload code
- Added solrEscape() reusable function
- Check Solr response status after delete
- Added step-by-step comments throughout
@sebiboga
sebiboga force-pushed the fix/delete-null-payload branch from 5afc5f2 to d7b79b5 Compare July 28, 2026 09:10
@sebiboga
sebiboga merged commit 5a710b8 into master Jul 28, 2026
1 check passed
@sebiboga
sebiboga deleted the fix/delete-null-payload branch July 28, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants