Repository navigation
chore: sync release v1.74.1 to main branch - #6928
Merged
atzoum merged 2 commits intoMay 12, 2026
Merged
Conversation
🔒 Scanned for secrets using gitleaks 8.28.0
# Description
Fixes two CSV-formatting bugs in the Salesforce Bulk Upload destination
that surfaced for Fullscript while integrating against the Salesforce
Bulk API.
**Bug 1 — null values rendered as `<nil>`.** A trait whose JSON value
was `null` arrived in the CSV as the literal four-character string
`<nil>`, because `fmt.Sprintf("%v", nil)` is what the writer was using.
Salesforce treats this as a real text value rather than a null,
polluting target fields and breaking validation rules. The fix renders
top-level nulls as empty cells, which Salesforce treats as null/unset:
```
value1,,value3 // null in the middle field
value1,value2, // null in the trailing field
```
**Bug 2 — numeric values rendered in scientific notation.** Because
every JSON number lands in Go as `float64` and `%v` falls back to `%g`,
any integer-valued number with more than ~6 significant digits switched
to scientific notation. So a phone number `1234567890` was being
uploaded as `1.23456789e+09`, and an array of IDs as `[1.23456789e+09
9.87654321e+09]`. The fix uses `strconv.FormatFloat(v, 'f', -1, 64)` for
floats — same round-trip precision guarantee, never scientific notation.
Arrays and maps are emitted as JSON via `jsonrs.Marshal`, so nested
numbers also stay plain and nested nulls render as `null` instead of
`<nil>`.
The formatter (`FormatCSVValue`) lives in
`router/batchrouter/asyncdestinationmanager/common` so other async
destinations (Bing Ads, Lytics, Marketo, SFTP, Snowpipe discards) that
exhibit the same pattern can adopt it in follow-ups.
## Changes
- New `common.FormatCSVValue` helper that:
- returns `""` for top-level nil so CSV cells become empty
- formats `float64` via `strconv.FormatFloat(_, 'f', -1, 64)` to avoid
scientific notation
- emits `[]any` and `map[string]any` as JSON via `jsonrs.Marshal` (e.g.
`[1234567890,9876543210]`, `{"id":1234567890,"name":"foo"}`); falls back
to `fmt.Sprintf("%v", v)` if marshalling fails
- falls through to `fmt.Sprintf("%v", v)` for every other type so
existing primitives (string, bool) are byte-identical
- Salesforce Bulk's `createCSVFile` now routes every cell through
`common.FormatCSVValue`
- New unit tests for the helper (`common/utils_test.go`) and end-to-end
CSV tests for null cells and numeric cells
(`salesforce-bulk-upload/utils_test.go`)
## Behavior change for arrays and maps
Composite values are now serialized as JSON instead of Go's default
`fmt.Sprintf("%v", …)` shape:
| Input | Before | After |
|---|---|---|
| `["Go", "Python"]` | `[Go Python]` | `["Go","Python"]` |
| `[1234567890, 9876543210]` | `[1.23456789e+09 9.87654321e+09]` |
`[1234567890,9876543210]` |
| `{"id": 1234567890}` | `map[id:1.23456789e+09]` | `{"id":1234567890}`
|
Primitive cells (strings, bools, small ints, fractional floats) and null
cells are byte-identical to the old output where it was already correct.
The hash-based job-to-record matching in `matchRecordsToJobs` is
unaffected because Salesforce echoes the exact CSV cell back in
success/failure records — both sides of the hash change together, and
`dataHashToJobID` has no cross-run state.
## Linear Ticket
[INT-6278 — Salesforce bulk upload: Fix null and array
formatting](https://linear.app/rudderstack/issue/INT-6278/salesforce-bulk-upload-fix-null-and-array-formatting)
## Security
- [x] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.
🤖 I have created a release *beep* *boop* --- ## [1.74.1](v1.74.0...v1.74.1) (2026-04-29) ### Bug Fixes * salesforce bulk upload null and numeric CSV formatting ([#6923](#6923)) ([dec04f3](dec04f3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6928 +/- ##
==========================================
+ Coverage 80.01% 80.15% +0.13%
==========================================
Files 565 565
Lines 63372 63388 +16
==========================================
+ Hits 50707 50807 +100
+ Misses 9664 9603 -61
+ Partials 3001 2978 -23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
itsmihir
approved these changes
May 12, 2026
itsmihir
enabled auto-merge (squash)
May 12, 2026 10:02
atzoum
approved these changes
May 12, 2026
atzoum
disabled auto-merge
May 12, 2026 10:38
fracasula
approved these changes
May 12, 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.
Description
Syncing patch release v1.74.1 to main branch
↓↓ Please review and edit commit overrides before merging ↓↓
BEGIN_COMMIT_OVERRIDE
fix: salesforce bulk upload null and numeric CSV formatting (#6923)
END_COMMIT_OVERRIDE