Skip to content

[HR] Trailing watcher events create no-op passes that can overwrite a request outcome #23862

Closed

Description

@dr1rrb

Current behavior

FileUpdater.UpdateAsync writes a request's edits and its hot-reload info file while
holding the BufferGate, so the file-system observer flushes them as one batch — by
design. But trailing file-system events (e.g. a close-write delivered after the 250 ms
buffer already closed, observed on Linux/inotify during a long first pass) re-open a
new batch for files whose content is already in the solution. That parasite pass:

  1. forks the solution anyway (replacing a document with byte-identical text still creates
    a new snapshot), so it misses the result.Solution == originalSolution → NoChanges
    shortcut;
  2. emits (Found 0 metadata updates after 0.007s — measured) and lands in the
    blocked-compilation audit ([HR] Blocked-compilation audit judges the whole solution on passes that did not touch it #23861);
  3. worst: if it arrived while the originating request's operation was still open, it is
    merged into it — and since operations are completed by the pass that processes them,
    the parasite pass overwrites the real outcome. Observed live: the batch pass
    applied the request's edits successfully, the parasite pass completed the merged
    operation as Failed, and the request — correlated to that operation through the info
    file — reported failure for an applied change.

Expected behavior

  • Content-level no-op detection in the solution update: identical text
    (SourceText.ContentEquals, documents and additional documents) is not re-applied; a
    fully-reduced batch returns the original solution instance and short-circuits as a
    silent NoChanges (no emit, no audit).
  • A vacuous continuation pass never degrades the outcome of the operation it merged into
    (Success/RudeEdit/Failed-with-diagnostics are preserved).
  • No special-casing of the info file: its content genuinely changes per request and keeps
    flowing in the request's batch; the dedup is strictly content-based.

Environment

src/Uno.HotReload/IO/FileUpdater.cs (BufferGate batching),
src/Uno.HotReload/FileSystemObserver.cs (250 ms two-step buffer),
src/Uno.HotReload/HotReloadManager.cs (merge + completion lifecycle).

Activity

  1. Jen-Uno commented on Sep 30, 2026

    @Jen-Uno
    Contributor

    QA: closing out without a manual pass. The fix in #23865 ships with automated tests (Given_HotReloadManager.cs, Given_SolutionUpdater.cs, RecordingReporter.cs and 1 more) that exercise the change.

    If you still see this behaviour on a build that includes that PR, please reopen or comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions