Skip to content

fix(slack): safely stringify object-valued properties and traits - #5832

Draft
rudder-devbox[bot] wants to merge 1 commit into
developfrom
harness/INT-7763-fix-slack-safely-stringify-obje-6549da33
Draft

rudder-devbox[bot] wants to merge 1 commit into
developfrom
harness/INT-7763-fix-slack-safely-stringify-obje-6549da33

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

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 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.

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, 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)

@rudder-devbox

rudder-devbox Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

👋 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.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

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.

Share

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

2 participants