Repository navigation
Release v2.1.1: query strings Fleetbase APIs can read - #51
Merged
Merged
Conversation
v2.0 sent arrays as repeated keys (ids=1&ids=2). PHP and Laravel keep only the last of those, so every multi-value filter or parameter reached Fleetbase APIs as a single value. Lists are now ids[]=1&ids[]=2, nested objects filter[active]=true and lists of objects stops[0][id]=s1, as SDK v1 sent them on native through axios. Nested objects were JSON-encoded before.
2 of 3 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 860 860
Branches 143 143
=========================================
Hits 860 860 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
v2.0 and v2.1.0 send array query values as repeated keys:
tagged=a&tagged=b. PHP and Laravel keep only the last value of a repeated key, so any multi-value parameter reaches Fleetbase APIs as a single value. Two consequences found in the Storefront app:SDK v1 on native went through axios, which sent
tagged[]=a&tagged[]=b. The v2 Fetch rewrite changed the format.Fix
appendQuerynow uses PHP's bracket form:ids[]=1&ids[]=2filter[active]=truestops[0][id]=s1Dates are still sent as ISO strings, and null, undefined and empty lists are still left out. Nested objects used to be JSON-encoded and are now bracketed too, as axios did.
Tests
Release
Merging into
maintags and publishes v2.1.1.@fleetbase/storefrontrequires^2.1.0, so it picks this version up without a release of its own. A storefront-js v2.0.1 follows anyway, to raise the minimum and rebuild its browser bundle.