Skip to content

fix: prevent redundant restarts on rapid changes and recover from app crashes in watch mode#6036

Open
edusperoni wants to merge 1 commit into
mainfrom
fix/rebuilding-and-crash
Open

fix: prevent redundant restarts on rapid changes and recover from app crashes in watch mode#6036
edusperoni wants to merge 1 commit into
mainfrom
fix/rebuilding-and-crash

Conversation

@edusperoni
Copy link
Copy Markdown
Collaborator

@edusperoni edusperoni commented May 17, 2026

Two issues in the livesync watch loop:

  1. Multiple rapid file changes caused each webpack recompilation to trigger a separate sync+restart, even when earlier restarts were already stale. Added exhaustMapWithTrailing semantics: while a sync is in progress, incoming compilation events are coalesced per-platform into a single pending event that runs after the current sync completes.

  2. If the app crashed at certain times (e.g. during JS startup), the error handler removed the device from the descriptor list and stopped watchers, permanently killing the watch loop. Fixed by no longer calling stop() on transient sync errors — the device stays in the list and retries on the next file change. Also added .catch() to the promise action chain so a rejected action no longer breaks all subsequent chained actions.

… crashes in watch mode

Two issues in the livesync watch loop:

1. Multiple rapid file changes caused each webpack recompilation to trigger a
   separate sync+restart, even when earlier restarts were already stale. Added
   exhaustMapWithTrailing semantics: while a sync is in progress, incoming
   compilation events are coalesced per-platform into a single pending event
   that runs after the current sync completes.

2. If the app crashed at certain times (e.g. during JS startup), the error
   handler removed the device from the descriptor list and stopped watchers,
   permanently killing the watch loop. Fixed by no longer calling stop() on
   transient sync errors — the device stays in the list and retries on the
   next file change. Also added .catch() to the promise action chain so a
   rejected action no longer breaks all subsequent chained actions.
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