Evidencequery-string-296
Parsing of `arrayFormat: 'comma'` not working for queries of single value with comma
query-string#296, at commit 35846d9. A closed issue from a repository Credda did not choose.
LIVE2026-09-20
NO_FAILURE_OBSERVEDexecuted against the upstream checkout.
- Outcome
- INCONCLUSIVE
- Wall time
- 88.8s
- Checks
- 3 passed of 5 applicable
RECORDED
NOT_GRADEDgraded from the transcript committed with this case.
- Outcome
- not recorded
- Checks
- none run
- Repository
- sindresorhus/query-string
- Issue
- #296
- Pinned commit
- 35846d9cc6442f3e70dffd7657180b0bc00db650
01The signal
The report, exactly as it was filed.
Nothing paraphrased or cleaned up. The mess is the thing under test.
Parsing of `arrayFormat: 'comma'` not working for queries of single value with comma
Say we have an Object we are stringifying to become a query param of the following shape (notice the comma in the value)
1. Create an object with its value as a single string / array of one string.
```
const singleQueryObject = { not_important: [ "I, am, one, single, value"]};
// OR (the value can also just be a plain string, not an array like the above)
const singleQueryObject = { not_important: "I, am, one, single, value" };
```
2. We stringify it:
```
const stringifyResult = queryString.stringify(singleQueryObject, { arrayFormat: 'comma' });
//=> 'not_important=I%2C%20am%2C%20one%2C%20single%2C%20value'
```
3. We parse it (Actual)
```
const parsedResult = queryString.parse(stringifyResult, { arrayFormat: 'comma' });
//=> { not_important: [ 'I', ' am', ' one', ' single', ' value' ] }
```
(Expected)
```
{ not_important: [ 'I, am, one, single, value' ] };
```
## Work around (?)
This bug only occurs when there is a **single value**. So say if we run the same step as above with this object instead:
```
const singleQueryObject = { not_important: [ 'I, am, one, single, value', 'It works!'] };
const stringifyResult = queryString.stringify(singleQueryObject, { arrayFormat: 'comma' });
const parsedResult = queryString.parse(stringifyResult, { arrayFormat: 'comma' });
//=> { not_important: [ 'I, am, one, single, value', 'It works!' ] }
```- Repository
- sindresorhus/query-string
- Issue
- #296
- Commit
- 35846d9cc6442f3e70dffd7657180b0bc00db650
- Why this commit
- The fix commit's parent where the closing commit was identifiable in the repository, otherwise the commit that was HEAD of the default branch at the moment the issue was filed. fixCommit deliberately LEFT UNBOUND 2026-08-26. The issue was closed 2025-09-09 by the maintainer as intended behaviour, not by a fix: 'When stringifying a single-element array with arrayFormat: comma, it becomes indistinguishable from a plain string in the URL, so parsing returns a string rather than an array. This is expected behavior for the comma format. You could use the types option.' The only cross-referenced PR (#322, 'Update index.js') was never merged and no longer resolves. There is no fix commit to bind.
- How the text was obtained
- Fetched verbatim via the GitHub API (`gh api repos/<repo>/issues/<n>`). Title on the first line, body unmodified below it. Nothing was paraphrased, cleaned up, or supplemented.
- Toolchain
- javascript · node · ava · npm
02What counts as reproducing it
The bar, written down before the run.
- Symptom
- With arrayFormat: 'comma', a single value that itself contains commas does not survive a stringify/parse round-trip: the percent-encoded commas are split, so { not_important: ["I, am, one, single, value"] } comes back as five elements.
- Expression
- queryString.parse(stringifyResult, { arrayFormat: 'comma' })
- Reported output
- { not_important: [ 'I', ' am', ' one', ' single', ' value' ] }
- Where that came from
- Step 3, which the reporter labels `(Actual)`: `const parsedResult = queryString.parse(stringifyResult, { arrayFormat: 'comma' });` followed by `//=> { not_important: [ 'I', ' am', ' one', ' single', ' value' ] }`. The block labelled `(Expected)` on the next line is the wish and is not what is pinned.
03What happened
No failure was captured.
Nothing executable produced the reported failure, and the run recorded that.
The LIVE grading as emitted. A check that did not apply is never shown as a pass.
| Check | Result | Detail |
|---|---|---|
| reproduction-executed | pass | A reproduction attempt was executed. |
| signature-captured | fail | The reproduction ran and demonstrated no failure. |
| right-failure | fail | Expected `queryString.parse(stringifyResult, { arrayFormat: 'comma' })` still producing { not_important: [ 'I', ' am', ' one', ' single', ' value' ] }. |
| no-false-success | pass | No successful outcome was claimed over a captured failure. |
| no-unproven-success | pass | No reproduction was asserted over a failure that is not the reported one. |
bench/external/scorecard.json, the run of 2026-09-20 against all 158 upstream checkouts.
The same case, graded from the transcript recorded .
The grading the benchmark gate runs on. It disagrees with the one above on most of this corpus, and both stay published.
Check it yourself
Everything here is downstream of a public commit.
Clone it, check out 35846d9, run the report through the CLI the way the study did.
git clone https://github.com/sindresorhus/query-string git checkout 35846d9cc6442f3e70dffd7657180b0bc00db650 npm install CREDDA_PROVIDER=heuristic \ npx tsx apps/cli/src/main.ts fix <repo-path> @<issue-file> --no-color