Skip to content

fix(slack): resolve actor name via direct user lookup instead of paginated list[ES-557] - #11263

Merged
Harika Kondur (harikakondur) merged 1 commit into
masterfrom
es-557
Aug 7, 2026
Merged

fix(slack): resolve actor name via direct user lookup instead of paginated list[ES-557]#11263
Harika Kondur (harikakondur) merged 1 commit into
masterfrom
es-557

Conversation

@harikakondur

Copy link
Copy Markdown
Contributor

Purpose

Customer reported (ES-557) that Slack entry notifications show a raw, illegible user ID instead of the author's name — despite #11167 already adding actor name resolution.

Approach

getUserName was resolving the actor's name by fetching cmaClient.user.getManyForSpace({}) — a paginated collection — and searching for the actor in the first page of results. For spaces with more members than the default page size (e.g. large orgs synced via SSO), an actor outside that first page was never found, silently falling back to the raw ID. This matches the customer's report.

Replaced the paginated list + .find() with a direct single-user lookup: cmaClient.user.getForSpace({ spaceId, userId }). This resolves the exact actor in one call, independent of space size, and still falls back to the raw ID if the lookup fails (e.g. deleted user).

getSpaceName was checked as part of this investigation — it already uses cmaClient.space.get({ spaceId }), a direct single-space lookup, so it was not affected by this bug.

Testing steps

  • Updated service.test.ts to stub user.getForSpace instead of user.getManyForSpace.
  • Added a test asserting the ID fallback still works when the user lookup fails/rejects.
  • npm test, tsc --noEmit, and eslint all pass on the changed files.

@harikakondur
Harika Kondur (harikakondur) marked this pull request as ready for review August 7, 2026 18:34
Copilot AI lite review requested due to automatic review settings August 7, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@harikakondur
Harika Kondur (harikakondur) merged commit 7a7917e into master Aug 7, 2026
15 checks passed
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.

3 participants