Repository navigation
fix(web): support source search over insecure LAN HTTP - #738
Merged
Merged
Conversation
Use the existing ID fallback for source searches and native queues, and protect search request setup with error handling and cleanup. Guard source callers with a recursive UUID scan and missing-API UI tests; clarify clipboard fallback guidance. Fixes #736 Co-Authored-By: qin hector <hectorq.me@gmail.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Fixes #736. Over LAN plain HTTP the page is not a secure context, so
crypto.randomUUIDis undefined. Source search called it aftersetBusy(true)but before itstryblock. The resulting TypeError meant the request was never sent and the page stayed on 正在搜索 forever.SourceCatalogPage,SourcesPageand the native queue inplayer.tsnow use the existingnewId()fromcore/id.ts. It falls back togetRandomValues, which works over HTTP.try/catch/finally. If anything throws before the request, the page shows an error and clears busy/searching instead of hanging.test/id.test.tsfails if any file inweb/srcother thancore/id.tsreferencescrypto.randomUUID. The repo has no ESLint, so this test is the guard.navigator.clipboard.writeTextexists. If it does not, a visible message suggests system copy, download or HTTPS, instead of failing silently.crypto.subtle, mediaDevices, share and wakeLock are not used.Tested in headful Chromium against the real server on
http://<LAN IP>:5890/, whereisSecureContext === falseandrandomUUIDis undefined. Search on the sources page, an empty search and catalog search all reached the server (200 event-stream) and completed, with no page errors. New tests stub outrandomUUIDand cover success, empty, request-error and setup-error/retry on both pages.Implemented in session Review reader project and suggest improvements
Review with Devin · Open in Devin Desktop