Skip to content

Fix false conflict detection when revisionHistory is empty#520

Open
zorox-106 wants to merge 1 commit intotheatre-js:mainfrom
zorox-106:main
Open

Fix false conflict detection when revisionHistory is empty#520
zorox-106 wants to merge 1 commit intotheatre-js:mainfrom
zorox-106:main

Conversation

@zorox-106
Copy link
Copy Markdown

Fixes #514 (reported by @White-Devil2839)

Problem: New projects with empty revisionHistory (the default) incorrectly show "Browser state is not based on disk state" warning on every reload.

Cause: onDiskState.revisionHistory[0] returns undefined when empty, and indexOf(undefined) always returns -1, triggering false conflicts.

Fix: Added check for undefined before performing revision lookup in
initialiseProjectState.ts
.

Changed file:
packages/core/src/projects/initialiseProjectState.ts

When a project's revisionHistory is empty (the default for new projects),
initialiseProjectState was incorrectly detecting conflicts. This happened
because onDiskState.revisionHistory[0] returned undefined, and indexOf(undefined)
always returned -1, triggering the conflict warning.

This fix adds a check to ensure the revision exists before performing the lookup,
preventing false conflicts while preserving existing behavior for projects with
actual revision histories.
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 3, 2025

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

Project Deployment Preview Comments Updated (UTC)
theatre-playground Error Error Dec 3, 2025 1:16pm

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 3, 2025

CLA assistant check
All committers have signed the CLA.

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.

False conflict detection when revisionHistory is empty

2 participants