fix: restore macOS startup support#1442
Open
zouyonghe wants to merge 1 commit intognmyt:developmentfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fetch, which works reliably in Deno on macOSProblem
MySpeed could not complete startup on macOS. The Ookla bootstrap metadata only covered
darwin/x64with a stale archive name and had nodarwin/arm64entry, so Apple Silicon startup failed before the CLI could load. After fixing that, startup still surfaced an unhandledAggregateErrorbecause server list prefetching ran as top-level fire-and-forget requests inloadServers.js. In this environment the LibreSpeed bootstrap endpoint was reachable via nativefetch, 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/x64anddarwin/arm64use Ookla's officialmacosx-universal.tgzarchive. 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.jsexports awaited loader functions for Ookla and LibreSpeed, preserves the existing cache file formats, surfaces provider-specific failures with clearer errors, and usesfetchby default instead of Axios for bootstrap requests.server/index.jsnow awaits server prefetch before continuing startup and routes startup failures through the existingerrorHandler, 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/publicrather 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.jsdeno test server/util/loadServers.test.jsdeno test --allow-read server/templates/env.test.jsdeno 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