feat(replays): Add replay timeline inspector - #1178
Draft
sentry-junior[bot] wants to merge 2 commits into
Draft
Conversation
Co-Authored-By: OpenAI Codex <codex@openai.com> Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: OpenAI Codex <codex@openai.com> Co-Authored-By: David Cramer <david@sentry.io>
Comment on lines
+209
to
+211
| const aroundMs = params.aroundTimestamp | ||
| ? Date.parse(params.aroundTimestamp) | ||
| : null; |
There was a problem hiding this comment.
aroundTimestamp Date.parse NaN silently filters all timeline events
Date.parse is not guarded for NaN, so valid-ISO but unparsable timestamps silently filter out all events.
Evidence
aroundTimestamppassesz.string().datetime({ offset: true })validation, butDate.parsecan still returnNaNfor valid-format but out-of-range dates (e.g.,"0000-01-01T00:00:00Z").aroundMsis assignedDate.parse(params.aroundTimestamp)without aNumber.isNaNcheck (line 209).- The window filter
Math.abs(event.timestampMs - aroundMs) <= windowMsevaluates toNaN <= windowMs, which is alwaysfalse(line 221). - Every event is excluded and the caller receives an empty
eventsarray with no error or warning. parseTimestamp(replay.started_at)in the same file correctly guards againstNaNat line 425–426, showing the expected pattern was omitted foraroundTimestamp.
Identified by Warden · code-review · E2J-4UD
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.
Add a catalog-only
inspect_replay_timelinetool that reconstructs timestamped replay activity so agents and clients can explain what happened around an error or frustrating interaction.Structured Timeline Contract
The tool declares an output schema and returns structured-only results with replay identity, availability status, applied filters, pagination counts, and typed timeline events. Each event carries absolute and replay-relative timestamps plus typed key/value details; compatibility text is generated by the MCP server.
Focused Inspection
Callers can filter by event category, focus on an absolute timestamp window, and cap the returned timeline. Archived and segmentless replays use the same stable output shape with an explicit status and unavailable reason.
Project constraints remain enforced, replay recording failures remain visible, and the tool stays catalog-only behind the existing replay capability.