Files
direct-img.link/functions
multipleof4andClaude Opus 5.5 07564bade2 Fix: Finish searches when the client disconnects, and download candidates in parallel
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>
2026-10-12 02:14:20 +00:00
..