Skip to content

Release v2.1.1: query strings Fleetbase APIs can read - #51

Merged
roncodes merged 2 commits into
mainfrom
release/v2.1.1
Oct 8, 2026
Merged

roncodes merged 2 commits into
mainfrom
release/v2.1.1

Conversation

@roncodes

@roncodes roncodes commented Oct 8, 2026

Copy link
Copy Markdown
Member

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:

  • store filters with several tags apply only the last tag;
  • a service quote for a cart with items from several stores sends only one origin.

SDK v1 on native went through axios, which sent tagged[]=a&tagged[]=b. The v2 Fetch rewrite changed the format.

Fix

appendQuery now uses PHP's bracket form:

  • lists: ids[]=1&ids[]=2
  • nested objects: filter[active]=true
  • lists of objects: stops[0][id]=s1

Dates 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

  • The query test now asserts the exact URL for lists, nested objects, nested lists, dates and lists of objects.
  • The compatibility test that had locked in the repeated-key format is updated.
  • 37/37 tests pass with 100% coverage. Typecheck, lint, format and release validation are clean.

Release

Merging into main tags and publishes v2.1.1. @fleetbase/storefront requires ^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.

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.
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (91d5660) to head (4ddcf8d).

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.
📢 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.

@roncodes
roncodes merged commit f1cbeb7 into main Oct 8, 2026
44 checks passed
@roncodes
roncodes deleted the release/v2.1.1 branch October 8, 2026 15:34
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.

1 participant