Skip to content

fix: restore macOS startup support#1442

Open
zouyonghe wants to merge 1 commit intognmyt:developmentfrom
zouyonghe:development
Open

fix: restore macOS startup support#1442
zouyonghe wants to merge 1 commit intognmyt:developmentfrom
zouyonghe:development

Conversation

@zouyonghe
Copy link
Copy Markdown

Summary

  • restore macOS startup support by mapping the Ookla bootstrap to the official universal archive for both Intel and Apple Silicon Macs
  • replace fire-and-forget server list prefetching with explicit awaited startup loaders and switch the LibreSpeed bootstrap request path to fetch, which works reliably in Deno on macOS
  • document macOS source-based startup in the README files and make the dev-mode page use local logo assets instead of an external Imgur dependency

Problem

MySpeed could not complete startup on macOS. The Ookla bootstrap metadata only covered darwin/x64 with a stale archive name and had no darwin/arm64 entry, so Apple Silicon startup failed before the CLI could load. After fixing that, startup still surfaced an unhandled AggregateError because server list prefetching ran as top-level fire-and-forget requests in loadServers.js. In this environment the LibreSpeed bootstrap endpoint was reachable via native fetch, but the previous Axios-based request path timed out, which prevented the application from reaching a listening state.

The dev-mode fallback page also depended on an external Imgur image for the logo and favicon. When that asset returned rate-limit responses, the page rendered with broken images during local development.

Fix

This change updates the macOS Ookla binary mapping so both darwin/x64 and darwin/arm64 use Ookla's official macosx-universal.tgz archive. It also adds a regression test to lock that behavior in.

Server bootstrap loading is now explicit startup work instead of module-level side effects. loadServers.js exports awaited loader functions for Ookla and LibreSpeed, preserves the existing cache file formats, surfaces provider-specific failures with clearer errors, and uses fetch by default instead of Axios for bootstrap requests. server/index.js now awaits server prefetch before continuing startup and routes startup failures through the existing errorHandler, which avoids unhandled promise rejections and makes failures actionable.

To improve the local development experience, the dev-mode template now uses local logo assets served from client/public rather than relying on an external Imgur URL, and the README files now mention macOS source-based startup support.

Validation

  • deno test server/config/binaries.test.js
  • deno test server/util/loadServers.test.js
  • deno test --allow-read server/templates/env.test.js
  • deno eval "import { load as loadCli } from './server/util/loadCli.js'; await loadCli(); console.log('CLI providers loaded')"
  • timeout 25s deno run --allow-all server/index.js

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