Skip to content

Fix false conflict detection when revisionHistory is empty#519

Open
wcr-karan wants to merge 2 commits intotheatre-js:mainfrom
wcr-karan:fix/false-conflict-detection
Open

Fix false conflict detection when revisionHistory is empty#519
wcr-karan wants to merge 2 commits intotheatre-js:mainfrom
wcr-karan:fix/false-conflict-detection

Conversation

@wcr-karan
Copy link

Fix: False conflict detection when revisionHistory is empty

Issue:
Previously, initialiseProjectState would incorrectly flag a conflict between the browser state and disk state when the disk state had an empty revisionHistory. This occurred because onDiskState.revisionHistory[0] was undefined, causing the conflict check to fail even when no actual conflict existed.

Changes:

  • Modified packages/core/src/projects/initialiseProjectState.ts to explicitly check if onDiskState.revisionHistory has items before performing the conflict check.
  • If revisionHistory is empty, it now correctly assumes no conflict exists and proceeds to use the browser state.

Verification:

  • Verified locally with a reproduction test case (since removed to keep the PR clean).
  • Confirmed that the "Browser state is not based on disk state" warning no longer appears for projects with empty revision history.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vercel
Copy link

vercel bot commented Nov 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
theatre-playground Error Error Nov 29, 2025 10:20am

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.

2 participants

Comments