Skip to content

macos: enable host-driven BEAM restart in host-first bundle - #18

Merged
dominicletz merged 1 commit into
mainfrom
host-first-restart-beam
Aug 10, 2026
Merged

macos: enable host-driven BEAM restart in host-first bundle#18
dominicletz merged 1 commit into
mainfrom
host-first-restart-beam

Conversation

@dominicletz

Copy link
Copy Markdown
Contributor

Summary

Set the new [lifetime] INI keys (restart_beam, restart_max_attempts, restart_backoff_ms) when packaging the host-first macOS DesktopWebView bundle. This activates the native host's child-exit watcher added in elixir-desktop/webview#4 so the host (not heart) drives BEAM restart.

The host-first layout makes the native process the long-lived one, which inverts the heart model. With these settings the host watches the BEAM child, applies an exponential backoff, and respawns. system.prepare_quit from Elixir still suppresses respawn during a user-initiated quit.

The Erlang release generated by this packaging does not need -heart; the release script can run BEAM directly and the host takes care of restarts.

Test plan

  • Build a host-first macOS DMG with Desktop.Deployment.Package.MacOS; verify generated DesktopWebView.ini contains the three new keys in [lifetime]
  • Confirm packaging does not regress other INI keys or layout

Set the new [lifetime] INI keys (restart_beam, restart_max_attempts,
restart_backoff_ms) when packaging the host-first DesktopWebView app.
This activates the native host's child-exit watcher that replaces
heart as the BEAM restart mechanism.

Pairs with elixir-desktop/webview PR #4 which adds the watcher and
keys. The Erlang release generated by this packaging does not need
-heart; the host is the long-lived process.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@dominicletz
dominicletz merged commit 7ed2a20 into main Aug 10, 2026
0 of 2 checks passed
dominicletz added a commit that referenced this pull request Aug 10, 2026
The host-driven BEAM restart commit (#18) introduced a `case` clause
in `Desktop.Deployment.Package.MacOS.release/1` that the current
formatter rewrites with blank lines between branches. The CI `mix lint`
alias runs `format --check-formatted`, which has been failing on main
since #18.

Reformat the `case` so the file passes the formatter check.

Co-authored-by: Cursor <cursoragent@cursor.com>
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