fix(net): join array fieldlist in net.retrieve so the documented usage works#477
Merged
wmathurin merged 2 commits intoJul 7, 2026
Merged
Conversation
…e works The documented/typed signature passes fieldlist as string[], but the raw array was forwarded straight to the native bridge as the `fields` query param. On Android, ArrayList.toString() produces "[FirstName, LastName]"; on iOS, NSArray's description gives a similar bracketed form — both are rejected by Salesforce with INVALID_FIELD / 400. The only working form (a pre-joined string) contradicted the TypeScript signature. Fix: join the array to a comma-separated string before the bridge crossing. A string is passed through unchanged for backward compatibility with callers that pre-join before passing. Also adds tsconfig.build.json so dist/ can be regenerated reproducibly via `tsc --project tsconfig.build.json` (the base tsconfig sets noEmit:true for type-checking only). setversion.sh updated to use this config, closing the gap where dist/ was previously hand-synced or relied on a separate unreproducible release-time step. The dist/ regeneration in this commit also picks up TypeScript version drift (null-coalescing rewrite, class field declarations) — functionally identical changes. Credit to @james-enperso for identifying the bug and the noEmit build discrepancy in PR forcedotcom#475.
2 tasks
|
||||||||||||||
…ative into fix/net-retrieve-array-fieldlist
|
||||||||||||||
3 tasks
brandonpage
approved these changes
Jul 7, 2026
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
net.retrieve's public, typed signature acceptsfieldlist: string[]:But the array was passed straight through to the native bridge as the
fieldsquery param. On Android,ArrayList.toString()producesfields=[FirstName, LastName]; on iOS,NSArray'sdescriptiongives a similar bracketed form. Both are rejected by Salesforce withINVALID_FIELD/ 400. The only form that actually worked — a pre-joined string — contradicted the TypeScript signature. The shared test suite only ever passed a pre-joined string, so the typedstring[]path was never exercised.Credit to @james-enperso for identifying the bug and the
noEmitbuild discrepancy in PR #475.Fix
Join the array before it crosses the bridge. A string is passed through unchanged for backward compatibility with callers that pre-join:
Build infrastructure fix
This PR also fixes the
dist/regeneration problem identified by @james-enperso.The root issue:
tsconfig.jsonextends@react-native/typescript-configwhich setsnoEmit: true, sonpm run build(tsc --build) type-checks only and never regeneratesdist/. The committeddist/was CommonJS output from a separate config, meaning any change tosrc/required either hand-editingdist/(fragile) or knowing about an undocumented release-time step.This PR adds
tsconfig.build.json— a config that extendstsconfig.jsonbut overridesnoEmit: false,module: commonjs,moduleResolution: node— sodist/can be regenerated reproducibly by anyone withtsc --project tsconfig.build.json.setversion.shis updated to callnpx tsc --project tsconfig.build.jsoninstead ofnpm run build, so the release process now produces a correctdist/automatically.The
dist/regeneration in this commit also picks up TypeScript version drift (??operator replacing verbose null-coalescing patterns, class field declarations at class body level) — all functionally identical.Test plan
net.retrieve('Contact', id, ['FirstName', 'LastName'], ...)works on iOSnet.retrieve('Contact', id, ['FirstName', 'LastName'], ...)works on Androidnet.retrieve('Contact', id, 'FirstName,LastName', ...)still works on both platformstsc --project tsconfig.build.json— should produce cleandist/with no errors🤖 Generated with Claude Code