Skip to content

chore: sync release v1.74.1 to main branch - #6928

Merged
atzoum merged 2 commits into
masterfrom
sync-release-15455a2c210747df7e5cd3ca0f23a8563913a7a7
May 12, 2026
Merged

atzoum merged 2 commits into
masterfrom
sync-release-15455a2c210747df7e5cd3ca0f23a8563913a7a7

Conversation

@rudderstack-github-actions

Copy link
Copy Markdown
Contributor

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

ItsSudip and others added 2 commits April 29, 2026 16:09
🔒 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

codecov Bot commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.15%. Comparing base (35b07a8) to head (15455a2).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...atchrouter/asyncdestinationmanager/common/utils.go 84.61% 1 Missing and 1 partial ⚠️
...destinationmanager/salesforce-bulk-upload/utils.go 50.00% 1 Missing and 1 partial ⚠️
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.
📢 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.

@itsmihir
itsmihir enabled auto-merge (squash) May 12, 2026 10:02
@atzoum
atzoum disabled auto-merge May 12, 2026 10:38
@atzoum
atzoum merged commit 5e67a45 into master May 12, 2026
182 of 187 checks passed
@atzoum
atzoum deleted the sync-release-15455a2c210747df7e5cd3ca0f23a8563913a7a7 branch May 12, 2026 10:38
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.

4 participants