Skip to content

Conversation

@ethanndickson
Copy link
Member

Reviews were rendering in non-deterministic order because createReview defaulted to Date.now() for timestamps. When multiple calls happened in the same millisecond, the sort became unstable.

Added explicit baseTime + N timestamps to affected stories:

  • ReviewsBanner
  • AllReviewsChecked
  • ManyReviews

This fixes chromatic flakes where review order would vary between runs.

Generated with mux

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes non-deterministic ordering of reviews in Storybook stories by introducing explicit timestamps. The issue occurred when multiple createReview calls executed within the same millisecond, causing unstable sorting and chromatic test flakes.

Key changes:

  • Added deterministic base timestamp (1700000000000) to three story setups
  • Incremented timestamps for each review to ensure stable ordering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Reviews were rendering in non-deterministic order because createReview
defaulted to Date.now() for timestamps. When multiple calls happened in
the same millisecond, the sort became unstable.

Added explicit baseTime + N timestamps to affected stories:
- ReviewsBanner
- AllReviewsChecked
- ManyReviews

This fixes chromatic flakes where review order would vary between runs.

_Generated with mux_
@ethanndickson ethanndickson added this pull request to the merge queue Dec 10, 2025
Merged via the queue into main with commit 5ac2a94 Dec 10, 2025
20 checks passed
@ethanndickson ethanndickson deleted the reviews-9x6d branch December 10, 2025 02:42
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.

1 participant