Skip to content

fix: use 'is not None' checks for json parameter to preserve falsy values#622

Closed
vdusek wants to merge 1 commit intomasterfrom
fix/http-client-falsy-json-values
Closed

fix: use 'is not None' checks for json parameter to preserve falsy values#622
vdusek wants to merge 1 commit intomasterfrom
fix/http-client-falsy-json-values

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Feb 17, 2026

Summary

  • _prepare_request_call used truthiness checks (if json) to detect JSON payloads
  • This silently dropped valid falsy JSON values: 0, "", [], {}, False
  • For example, json=[] (empty list) would not be serialized or sent to the API
  • Changed both the conflict check and the serialization gate to use is not None

Test plan

  • Verify existing unit tests pass
  • Verify that http_client.call(..., json=[]) correctly sends an empty JSON array

🤖 Generated with Claude Code

…lues

Truthiness checks (if json) silently dropped valid falsy JSON payloads
like 0, "", [], {}, and False. For example, posting json=[] would not
serialize or send the empty list. Changed to explicit None checks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vdusek vdusek added bug Something isn't working. adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Feb 17, 2026
@vdusek vdusek self-assigned this Feb 17, 2026
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.02%. Comparing base (e7ee8b3) to head (a5e3964).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #622   +/-   ##
=======================================
  Coverage   76.02%   76.02%           
=======================================
  Files          42       42           
  Lines        2482     2482           
=======================================
  Hits         1887     1887           
  Misses        595      595           
Flag Coverage Δ
integration 68.77% <100.00%> (ø)
unit 64.66% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from Pijukatel February 17, 2026 15:29
Copy link
Contributor

@Pijukatel Pijukatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be worried that maybe we rely on this behavior somewhere...
Could you please add some tests with some values that would be previously ignored and now they would be handled?

@vdusek
Copy link
Contributor Author

vdusek commented Feb 17, 2026

I would be worried that maybe we rely on this behavior somewhere...
Could you please add some tests with some values that would be previously ignored and now they would be handled?

Might be the case. Closing and let's resolve it for the 3.x.

@vdusek vdusek closed this Feb 17, 2026
@vdusek vdusek deleted the fix/http-client-falsy-json-values branch February 27, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants