Skip to content

WASM: embedded asset fetch has no timeout, so a stalled URL hangs setup() forever #4023

Closed

Description

@zackees

Defect

Embedded assets are now awaited to completion before setup() (LittleFS parity), and the fetch has no timeout:

const response = await fetch(url);           // index.ts:769  -- no AbortSignal
...
const embeddedResults = await Promise.all(embeddedFiles.map(...));   // blocks setup()

If the asset host stalls, setup() never runs. The page shows a canvas that never starts and no error, forever.

This is a regression I introduced

Before the parity change, loading raced a 250ms timer:

await Promise.any([delay(250), streamingFilesPromise]);

That was wrong for parity -- it let setup() run against an empty file -- but it did guarantee the sketch always started. Replacing it with an unbounded wait traded a correctness bug for a liveness bug, and I did not notice because the happy path was all I tested.

Both properties are wanted: complete before setup(), and always reach setup().

Fix

  • Give the asset fetch an AbortSignal.timeout(...).
  • On timeout or failure, log clearly and start setup() anyway -- a sketch that runs with a missing asset can say so; one that never runs cannot.
  • Decide the budget, and whether it should scale with declared size rather than being a flat constant.

Research: what the WASM preview should do when a declared asset cannot be fetched. Failing the page loudly may be better than starting with a file that will never fill, given is_eof() stays false while read() returns 0 (see #4024).

Follows FastLED/cli#216.

Activity

  1. added 2 commits that reference this issue on Aug 31, 2026
    a2f08b2
    598bcf8
  2. moved this from Triage to Done in FastLED Trackeron Aug 31, 2026
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions