mirror of
https://github.com/direct-img/direct-img.link.git
synced 2026-10-14 00:45:19 +00:00
A reload during a slow first-time search (seen on mobile Chrome and Safari) made the runtime cancel the search mid-way. Its result was never stored and its lock never released, so the reload waited out the 45s lock and then served bad.webp. Logs show this as clientDisconnected invocations followed by a bad.webp. The search now runs under waitUntil, so it still stores its result and releases the lock, and the waiting reload serves the image. Image candidates were downloaded one at a time, so each dead or slow host could stall the search for its full 5s timeout. Up to 4 now download at once but are checked in result order, so ?i= picks the same image. Downloads still in flight are aborted once the image is found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>