feat(investigations): Show viewers on the investigation page - #126116
Merged
Merged
Conversation
arslnb
approved these changes
Sep 30, 2026
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-7or0dspvs.sentry.dev |
Base automatically changed from
danf/investigations-viewers-endpoint
to
master
September 30, 2026 23:45
Show who else has opened an investigation next to "Last update": people viewing it now first, with a green ring, then earlier viewers, faded. The list comes from the presence heartbeat, at the interval the backend returns.
wedamija
force-pushed
the
danf/investigations-viewers-ui
branch
from
September 30, 2026 23:46
e3ef6c8 to
4fda4ab
Compare
Comment on lines
+86
to
+88
| {total > viewers.length ? ( | ||
| <Text variant="muted" size="sm"> | ||
| +{total - viewers.length} |
Contributor
There was a problem hiding this comment.
Bug: The viewer overflow count +N is calculated using viewers.length instead of shown.length, leading to an inaccurate count when some viewers are no longer organization members.
Severity: LOW
Suggested Fix
The overflow count calculation should be changed from total - viewers.length to total - shown.length to accurately reflect the number of hidden viewers.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/investigations/detail/presence.tsx#L86-L88
Potential issue: The overflow count for viewers is calculated as `total -
viewers.length`. However, the number of avatars actually rendered is based on
`shown.length`. If a viewer has left the organization, their `userId` won't resolve to a
member, causing `shown.length` to be less than `viewers.length`. This results in the
`+N` overflow count underestimating the number of hidden viewers, making the total count
implied by the UI incorrect.
Did we get this right? 👍 / 👎 to inform future reviews.
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Show who else has opened an investigation next to "Last update": people viewing it now first, with a green ring, then earlier viewers, faded. The list comes from the presence heartbeat, at the interval the backend returns.