Skip to content

v0.88.0-beta.8

@nick-inkeep nick-inkeep tagged this 22 Oct 13:16
* PRD-9756 Update Parcel watcher for safe shutdown

* Revert "PRD-9756 Update Parcel watcher for safe shutdown"

This reverts commit 3ff12628dbb1d6945ae3a71946491dd8d18e607f.

* PRD-9756 Update Parcel watcher for safe shutdown

* PRD-9756 Reproduce Parcel teardown fatal

* PRD-9756 Drain Parcel operations before utility shutdown

* Revert "PRD-9756 Update Parcel watcher for safe shutdown"

This reverts commit f81c2446f7bb778a0b4f18dcba7909719e3ba18f.

* PRD-9756 Preserve native operation rejection state

* PRD-9756 Record watcher shutdown behavior

* PRD-9756 Drain Parcel work before CLI exit

* PRD-9756 Drain Parcel work after destroy failures

* PRD-9756 Cover late watcher and CLI shutdown paths

* PRD-9756 Bound late watcher shutdown

* PRD-9756 Join initialization before shutdown

* PRD-9756 Join shutdown initialization safely

* PRD-9756 Close late watcher registration

* PRD-9756 Finish watcher shutdown barriers

* PRD-9756 Close watcher admission during shutdown

* PRD-9756 Track watcher ownership through teardown

* PRD-9756 Withdraw unproven watcher registry candidate

* PRD-9756 Add a smoke case for quitting while the server releases watchers

The case holds the app's will-quit, asks the app to quit, and releases
the hold once the project server logs that its shutdown began. That lands
the quit inside the server's watcher release, which is where Electron
freeing the server utility's Node environment turns a pending Parcel
completion into a fatal error and a crash dump. It repeats the quit four
times on one profile and expects no crash dump from the app.

* PRD-9756 Drop the smoke case that could not force the quit timing

On the base it passed all four quits in dispatch run 39728593855: the
test released the held quit through Playwright after the server's watcher
release had already finished, so it never reached the failure it was
written to catch. The existing clean-quit case in
terminal-process-restart.e2e.ts did hit it on that run.

* PRD-9756 Add a regression for quitting while the server releases watchers

The test runs the real utility entry, boot, file watchers and Parcel in a
Worker under the real WindowManager, then quits the way Electron does:
the project window closes, will-quit runs the quit drain, and the end of
the main loop frees any server utility that has not exited. The harness
frees it as soon as the server's shutdown has a native watcher operation
in flight, the latest point Electron could reach, and reports whether
native work was pending when it did.

On the current window manager nothing waits for the utility, so the
harness aborts with the same napi_throw from PromiseRunner::onWorkComplete
that the desktop smoke recorded.

* PRD-9756 Wait for project servers to exit before the app quits

Quitting closes the project window, which asks the server utility to
shut down, and then let the app finish quitting at once. Electron then
shut the utility down at the end of its main loop and freed its Node
environment while the server was still releasing its file watchers, so a
pending Parcel completion ended the utility with a fatal error and a
crash dump that the next launch reported.

The window manager now records each server utility it forks until that
utility exits, and the will-quit drain waits for every one of them, as it
already does for the terminal host. A server still running after the
existing stop grace is terminated through its handle, and quit continues
once it has exited.

* PRD-9756 Start no project server once the app has begun quitting

A project open still in flight when the quit drain began could fork a
project server after the drain took its list of live servers, so the quit
went ahead without waiting for that server. Once the drain starts, the
window manager refuses to fork, and any open that then fails is reported
as cancelled by the quit. The open fallback logs that cancellation instead
of opening the Navigator with an error dialog while the app quits.

* PRD-9756 Let the utility's shutdown wait for a server start in progress

A shutdown that arrived while the project server was still starting exited
the utility at once, so the watchers that start subscribed were never
released. Shutdown now waits for the start to settle, shuts down the server
it produced, and only then exits; the start no longer announces ready once
shutdown has begun. A repeated shutdown returns the first teardown instead
of resolving before it finishes.

* PRD-9756 Release each file watcher at shutdown even when another fails

Destroy released the HEAD watcher and the content watcher under one catch,
so a HEAD watcher whose native release rejected left the content watcher
subscribed. Each release is now attempted on its own and records its own
phase error.

* PRD-9756 Hold the quit regression's native watcher work at a known point

The regression woke on a native watcher operation started during shutdown
but left the worker free to finish it before the harness freed the
utility, so its verdict depended on timing. Each such operation is now held
after it is queued until the harness decides: it is released while the
quit is still waiting, and the utility is freed while it is held once the
quit has gone ahead. A second case begins the quit while the server's start
has a native subscribe in flight. The harness counts native subscribes and
unsubscribes so the result shows every watcher released before exit, and
test cleanup now waits for each harness process to close before removing
its fixtures.

* PRD-9756 Observe the cancelled open before the drain test yields a turn

The test awaited an event-loop turn before attaching its rejection handler,
so the open's rejection reached Vitest as unhandled.

* PRD-9756 Add a changeset for releasing every watcher on server stop

The server's destroy now attempts each watcher release on its own, and the
CLI's ok start stops through it, so the published package changes behavior.

* PRD-9756 Log how each project server's shutdown ended at quit

The main process logged a utility's exit with Electron's synthetic code, and
the utility logged nothing as it exited, so a shutdown cut short showed only
as a stale lock on the next launch. The utility now logs when its shutdown
finishes and whether its server was destroyed, and the quit drain logs each
server's exit and whether the grace had to terminate it.

* PRD-9756 Say only what the quit-time shutdown logs and changeset can show

The utility's log now says whether its server's destroy resolved rather than
that the server was destroyed, the drain logs the pid it captured while the
server ran (Electron clears it before exit) and whether the grace expired
rather than whether the server was terminated, and the changeset says the
server keeps stopping its other watchers when one fails to stop.

* PRD-9756 Identify each drained project server by name and spawned pid

Utilities are tracked from fork, before Electron reports a pid, and Electron
clears the pid before it emits exit. The drain now logs the service name
recorded at fork and the pid recorded at spawn.

* Run the composed quit regression through the production quit drain

Move the will-quit drain's composition out of index.ts into app-quit-drain.ts,
whose dependencies are all required, and have the composed regression harness
call it instead of building its own drain list. Dropping the project-server
drain from production now fails the composed regression, and dropping it at the
index.ts call site fails the typecheck.

* Log the failure a quit-cancelled project open replaced

When a project open fails after the quit drain began, the open fallback now
records the original error and its kind, holder pid and exit fields on the
desktop-open-project-cancelled-by-quit event instead of dropping them. A window
manager test pins that the app-quitting rejection keeps the failure as its cause.

* Name the quit drain grace-expiry event under the quit-drain prefix

desktop-project-server-quit-grace-expired becomes
desktop-project-server-quit-drain-grace-expired, so one prefix query finds all
three quit-drain events.

* Keep inherited GIT_ variables out of the quit drain harness

The composed regression's harness child boots a real server that runs git in the
fixture, so its environment drops every inherited GIT_ variable before applying
the fixture's own, as the sibling git-touching tests do.

* Describe the quit drain and the utility shutdown in the desktop README

The Utility-fork bullet now covers the will-quit drain of forked project-server
utilities and the utility shutdown that joins a start in progress.

GitOrigin-RevId: 6b37bbff54ff5e812bbdc21ddcde9feeb9fbc9d4
Assets 2
Loading