Skip to content

JSON response handling improvements#1814

Merged
Oaphi merged 15 commits intodevelopfrom
0valt/voting-improvements
Sep 5, 2025
Merged

JSON response handling improvements#1814
Oaphi merged 15 commits intodevelopfrom
0valt/voting-improvements

Conversation

@Oaphi
Copy link
Member

@Oaphi Oaphi commented Sep 2, 2025

This PR further improves our handling of responses to JSON requests:

  • adds a QPixel#parseJSONResponse helper preventing silent failures when our API responds unexpectedly (such as 422 Unprocessable entity with text/html type);
  • adds several helper methods for standard handling of AJAX actions (vote, retractVote);
  • fixes a couple of inconsistencies with what we return in the status field;
  • makes several client API methods response parsing-safe & adds last resort notifications for end users;

I don't have time to apply these fixes everywhere at once, but I tried to cover as many cases as I can right now.

@Oaphi Oaphi requested review from a team, ArtOfCode- and cellio September 2, 2025 19:24
@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.44%. Comparing base (16d0278) to head (3453a96).
⚠️ Report is 22 commits behind head on develop.

Additional details and impacted files
Components Coverage Δ
controllers 71.26% <100.00%> (+0.38%) ⬆️
helpers 81.96% <ø> (ø)
jobs 60.00% <ø> (ø)
models 88.36% <ø> (ø)
tasks 61.11% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oaphi Oaphi added this to the v0.12.4 milestone Sep 2, 2025
@Oaphi Oaphi merged commit e6694c9 into develop Sep 5, 2025
13 checks passed
@Oaphi Oaphi deleted the 0valt/voting-improvements branch September 5, 2025 16:58
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