Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use allow_non_ref in JSON decoding of off-query #10587

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

stephanegigandet
Copy link
Contributor

We recently switched from JSON::PP to Cpanel::JSON::XS, and it looks like JSON::PP decode_json() was accepting to decode raw numbers, without having to specify allow_non_ref.

We had an issue when trying to deploy to prod, because on count requests, the return value we get from off-query is a raw number, which could not get decoded:

[2024/07/23 15:28:00] /srv/off/lib/ProductOpener/Display.pm 5369 ProductOpener.Display {error => '
JSON text must be an object or array (but found number, string, true, false or null, use allow_non
ref to allow this) at /srv/off/lib/ProductOpener/Data.pm line 140. ',request => 'qwfXeMshf0b7OpAF'
,tags => [{canon_tagid => 'en:canadaschtroumpf',display_tag => 'Canadaschtroumpf',new_tagid => 'en
:canadaschtroumpf',new_tagid_path => '/country/canadaschtroumpf',tag => 'en:canadaschtroumpf',tag_
prefix => '',tagid => 'en:canadaschtroumpf',tagtype => 'countries',tagtype_name => 'country',tagty
pe_path => '/countries'}]} MongoDB error

Copy link

sonarcloud bot commented Jul 23, 2024

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Maybe we should apply this also elsewhere ?

@alexgarel alexgarel enabled auto-merge (squash) July 23, 2024 16:05
@alexgarel alexgarel merged commit 1a8e82b into main Jul 23, 2024
13 checks passed
@alexgarel alexgarel deleted the json-fix branch July 23, 2024 16:34
alexgarel pushed a commit that referenced this pull request Jul 24, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.38.1](v2.38.0...v2.38.1)
(2024-07-24)


### Bug Fixes

* be consistent in regexp for props matching
([#10579](#10579))
([7f1d4ba](7f1d4ba))
* important fix in routing
([#10590](#10590))
([2106bef](2106bef))
* org name input field not displaying when checkbox is checked in pro
pl…
([#10588](#10588))
([9dfcf29](9dfcf29))
* use allow_non_ref in JSON decoding of off-query
([#10587](#10587))
([1a8e82b](1a8e82b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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