Skip to content

fix(slack): add nested profile object to get_user output so users.info-shaped references resolve#4954

Closed
waleedlatif1 wants to merge 90 commits into
stagingfrom
worktree-slack-output-investigation
Closed

fix(slack): add nested profile object to get_user output so users.info-shaped references resolve#4954
waleedlatif1 wants to merge 90 commits into
stagingfrom
worktree-slack-output-investigation

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add a nested profile object to the Slack Get User tool output, mirroring Slack's users.info API shape, so references like <block.user.profile.email> resolve instead of throwing InvalidFieldError
  • Wire the existing (previously unused) USER_PROFILE_OUTPUT_PROPERTIES schema into USER_OUTPUT_PROPERTIES and add a SlackUserProfile type
  • Existing flat fields (user.email, etc.) are unchanged for backward compatibility

Type of Change

  • Bug fix

Testing

Typecheck passes with no slack-related errors; block-outputs/block-reference/slack test suites pass (34 tests)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

waleedlatif1 and others added 30 commits April 3, 2026 23:30
…ership workflow edits via sockets, ui improvements
…ration, signup method feature flags, SSO improvements
* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <theo@sim.ai>

* fix(login): fix captcha headers for manual login  (#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha
…nts, secrets performance, polling refactors, drag resources in mothership
…endar triggers, docs updates, integrations/models pages improvements
…mat, logs performance improvements

fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (#4179)
fix(landing): return 404 for invalid dynamic route slugs (#4182)
improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170)
fix(gemini): support structured output with tools on Gemini 3 models (#4184)
feat(brightdata): add Bright Data integration with 8 tools (#4183)
fix(mothership): fix superagent credentials (#4185)
fix(logs): close sidebar when selected log disappears from filtered list; cleanup (#4186)
v0.6.46: mothership streaming fixes, brightdata integration
TheodoreSpeaks and others added 24 commits May 16, 2026 23:24
…s trimmed

v0.6.84: redis pub/sub SNI override, security hardening, copilot reads trimmed
…il integrations, markdown google docs creation
…oogle slides endpoints, DB access pattern improvements
…er, search & replace UX, kb connectors multi-select, mcp negative cache
…ter, hosted-key queueing

v0.6.92: enrichment table column type, table run fixes, scheduled jitter, hosted-key queueing
… messages table, user stats hot path improvements, RB2B
v0.6.95: data enrichment block, nullable workflow description fix
…ables UI improvements, new slack scopes, model-level denylists, object storage tracespans
…ion, together AI, Baseten, Ollama Cloud, Linq integrations, kb doc ownership bindings
…dgebase connector, SSO provider ID allowlist, singleton memory leak fix
…ration, smooth streaming, security hardening, db fixes
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 10, 2026 9:46pm

Request Review

@cursor

cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive response shape and schema metadata only; existing flat user fields are preserved and scope is limited to Get User.

Overview
Fixes Get User Info workflows that reference Slack’s native users.info shape (e.g. user.profile.email) by adding a nested profile object to the slack_get_user tool output and documenting it on the Slack block’s user output.

The slack_get_user transform now populates profile from the API’s user.profile (names, title, contact fields, status, and image_* URLs). USER_OUTPUT_PROPERTIES gains an optional nested profile using the existing USER_PROFILE_OUTPUT_PROPERTIES schema, plus a SlackUserProfile type on SlackUser. Top-level fields like user.email are unchanged.

Reviewed by Cursor Bugbot for commit d562353. Configure here.

@gitguardian

gitguardian Bot commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
29606901 Triggered Generic High Entropy Secret a54dcbe apps/sim/providers/utils.test.ts View secret
32763747 Triggered Generic Password 3e9849b helm/sim/tests/validators_test.yaml View secret
33881454 Triggered Generic Password 7ffc495 apps/sim/app/api/chat/utils.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a InvalidFieldError that occurred when workflows referenced user.profile.email (and similar users.info-shaped paths) on the Slack Get User tool output, by adding a nested profile object that mirrors Slack's API response structure.

  • Adds a profile sub-object to transformResponse in get_user.ts, populated with safe ?? '' / ?? null fallbacks for every field, so both flat references (user.email) and nested references (user.profile.email) work correctly.
  • Wires the pre-existing (but previously unused) USER_PROFILE_OUTPUT_PROPERTIES schema constant into USER_OUTPUT_PROPERTIES, and adds a SlackUserProfile TypeScript interface with profile?: SlackUserProfile on SlackUser to keep the type system in sync.

Confidence Score: 5/5

Safe to merge — the change is purely additive, all new fields fall back to empty strings or null, and existing flat fields on the output object are untouched.

The change adds a well-scoped nested profile object whose fields are always defensively initialized via ?? '' / ?? null. The USER_PROFILE_OUTPUT_PROPERTIES schema was already defined and validated; it's just now wired in. The SlackUser interface marks profile as optional, which is correct since it is only populated by get_user.ts and not by the list endpoint. No existing behavior is altered.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/tools/slack/get_user.ts Adds nested profile object to the transformResponse output, mirroring Slack's users.info shape; all fields fall back safely via ?? '' / ?? null.
apps/sim/tools/slack/types.ts Wires the pre-existing USER_PROFILE_OUTPUT_PROPERTIES into USER_OUTPUT_PROPERTIES, adds SlackUserProfile interface, and adds profile?: SlackUserProfile to SlackUser; backward-compatible and correctly typed.
apps/sim/blocks/blocks/slack.ts Updates the user output field description to document the newly-added email and nested profile shape.

Sequence Diagram

sequenceDiagram
    participant U as User/Block
    participant T as slackGetUserTool
    participant S as Slack users.info API

    U->>T: userId
    T->>S: "GET /api/users.info?user=<id>"
    S-->>T: "{ ok: true, user: { id, name, ..., profile: { email, display_name, ... } } }"
    T->>T: transformResponse()
    Note over T: Flat fields (user.email, user.display_name, ...)<br/>Nested profile (user.profile.email, user.profile.display_name, ...)
    T-->>U: "{ success: true, output: { user: { ...flatFields, profile: { ...profileFields } } } }"
Loading

Reviews (1): Last reviewed commit: "fix(slack): add nested profile object to..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 deleted the worktree-slack-output-investigation branch June 10, 2026 22:32
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