You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(slack): safely stringify object-valued properties and traits - #5832
Serialize object-valued Slack properties and traits as JSON before adding them to message text. Add utility and processor regression coverage for nested objects, a null-prototype object, allowlists, and scalar formatting.
What is the related Linear task?
Resolves INT-7763
Please explain the objectives of your changes below
Prevent the reported object-coercion exception from turning Slack processor transforms into 500 responses.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Nested object values now render as JSON rather than [object Object]. Discord also imports this formatter, so it receives the same rendering change. Scalar formatting and trait filtering remain unchanged.
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
The existing shared stringifyJSON utility now filters keys before converting values, using JSON serialization for non-null objects and string conversion for other values.
Any technical or performance related pointers to consider with the change?
This fix does not reclassify other serialization failures, such as circular objects or throwing toJSON methods. Double-braced Handlebars templates HTML-escape JSON quotes in the resulting message.
npx tsc --noEmit -p tsconfig.json, npx tsc --noEmit -p tsconfig.test.json, and npm run build:ci — passed.
Full generate:secret-paths and check:secret-paths using the integrations-config destination definitions — passed; no artifact diff.
Simplify pass: removed two no-op test callbacks and corrected a stale comment.
Local integration verification — skipped: the SHA-pinned transformer base image cannot run this checkout's edited source in the sandbox.
⚠️ Known Issues
Live source verification is unavailable for rudder-transformer in the local stack. The unit and component suites above exercise the changed code.
Circular object values and throwing toJSON methods can still fail before Slack error classification; handling those payloads is outside this fix.
Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change? No.
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.
⚠️ Auto-review unresolved
Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.
medium: Property and trait keys bypass escaping in Slack messages — src/v0/destinations/slack/util.js:92 — not auto-fixed (iteration budget exhausted)
medium: Discord renders serialized objects with HTML entities instead of JSON quotes — src/v0/destinations/slack/util.js:10 — not auto-fixed (iteration budget exhausted)
medium: SafeString list inputs break string-based and empty-list template expressions — src/v0/destinations/slack/transform.js:232 — not auto-fixed (iteration budget exhausted)
👋 I'm rudder-devbox. I opened this PR from task INT-7763.
Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f2b57614-7def-4c36-a646-9214af5a6ea0
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
What are the changes introduced in this PR?
Serialize object-valued Slack properties and traits as JSON before adding them to message text. Add utility and processor regression coverage for nested objects, a null-prototype object, allowlists, and scalar formatting.
What is the related Linear task?
Resolves INT-7763
Please explain the objectives of your changes below
Prevent the reported object-coercion exception from turning Slack processor transforms into 500 responses.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Nested object values now render as JSON rather than
[object Object]. Discord also imports this formatter, so it receives the same rendering change. Scalar formatting and trait filtering remain unchanged.Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
The existing shared
stringifyJSONutility now filters keys before converting values, using JSON serialization for non-null objects and string conversion for other values.Any technical or performance related pointers to consider with the change?
This fix does not reclassify other serialization failures, such as circular objects or throwing
toJSONmethods. Double-braced Handlebars templates HTML-escape JSON quotes in the resulting message.Validation
npm run lint— passed.npm test -- --testPathPattern='slack|discord' --no-coverage --runInBand --silent— passed (2 suites, 10 tests).npm run test:ts -- component --destination=slack --runInBand --silent— passed (10 tests).npm run test:ts -- component --destination=discord --runInBand --silent— passed (12 tests).npx tsc --noEmit -p tsconfig.json,npx tsc --noEmit -p tsconfig.test.json, andnpm run build:ci— passed.generate:secret-pathsandcheck:secret-pathsusing the integrations-config destination definitions — passed; no artifact diff.toJSONmethods can still fail before Slack error classification; handling those payloads is outside this fix.Developer checklist
Reviewer checklist
Adversarial self-review surfaced findings that were not auto-fixed. Each carries its disposition — please evaluate before merging.
src/v0/destinations/slack/util.js:92— not auto-fixed (iteration budget exhausted)src/v0/destinations/slack/util.js:10— not auto-fixed (iteration budget exhausted)src/v0/destinations/slack/transform.js:232— not auto-fixed (iteration budget exhausted)