Conversation
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| connect(allowUnauthenticated = false): void { | ||
| // An effect calls this. It must not depend on the state it changes, or every | ||
| // state change would reconnect at once and skip the backoff delay. |
There was a problem hiding this comment.
Reconnect timing lacks test coverage. The layout calls
connect() from an effect, and this untrack guard keeps connection-state changes from triggering immediate retries. There is no automated test for that timing, so a future change could silently bypass the backoff again. Please add a test that drops the connection and checks the retry intervals.
Knowledge Base Used: Frontend data and real-time state
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
…lite/euhesperides-d9702ac5--stores # Conflicts: # frontend/src/lib/stores/websocket.ts Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
* Fix auto_discover mounts being dropped at startup (#131) * Fix auto_discover mounts being dropped at startup Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Make the auto_discover test pick a mounted directory and check it is returned Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Make chunk_size_mb control browser upload chunks (#132) * Make chunk_size_mb control browser upload chunks Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Share one chunk size request across upload workers and respect cancel Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Resolve virtual paths in one place (#133) Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Parse WebSocket and job data at the boundary (#134) * Parse WebSocket and job data at the boundary Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Validate job progress range, add parser tests, log rejected frames briefly Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Move frontend state to runes and split the browse page (#136) * Migrate jobs and websocket stores to runes Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Migrate settings store to runes and split out appearance helpers Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Migrate auth store to runes Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Split the browse page into composables Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Keep the WebSocket reconnect backoff when connect runs in an effect Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Fix the auth API docs, drop stale comments, add AGENTS.md (#137) * Fix the auth API docs, drop stale spec comments, add AGENTS.md Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Add the frontend test command to AGENTS.md Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Correct the logout docs and scope the path rule Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Fix --dev failing config validation (#139) * Fix --dev failing config validation Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Isolate the dev credentials test from inherited BoxBox settings Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Test the WebSocket reconnect backoff (#138) * Test the WebSocket reconnect backoff Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Keep the connection mode on WebSocket retries and test the attempt limit Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Fix browsing discovered mount points Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> * Skip inaccessible auto-discovered mounts Co-authored-by: Radhey Kalra <radheykalra901@gmail.com> --------- Co-authored-by: usehoplite[bot] <288093033+usehoplite[bot]@users.noreply.github.com> Co-authored-by: Radhey Kalra <radheykalra901@gmail.com>
Problem
The frontend kept state in two styles. Auth, jobs, settings and the WebSocket used the old
svelte/storeAPI ($storesyntax,derivedstores,get()), while uploads, toasts and the clipboard already used runes. The browse page was one 876-line component that held URL state, queries, every dialog, file operations, drag-and-drop and the template, so no part could be read or changed on its own.Change
Each step is its own commit and passed
check,lintandbuildbefore the next.activejob list is a$derivedon the store.utils/appearance.ts. The async wallpaper lookup moves to an$effectin the layout.null as string | nullis gone with the old derived store.isAuthenticated,authErrorand the other derived stores become fields.lib/browse/:location(URL, history, sort, search),data(queries and derived lists),actions(dialogs, create, rename, delete, paste, clipboard, preview),uploads(picker and drag-and-drop) andselection.App.PageStatenow declaresbrowseHistoryIndex, which removes two casts.connect()readconnectionStateinside the layout's$effect, so the effect re-ran on every state change and reconnected at once. After a server restart the page opened 36 sockets in about 5 seconds. The state read is nowuntracked. The old store usedget(), which does not track.Old store files are deleted and every importer is migrated in this PR.
The reconnect timing is now tested (
websocket.test.ts). The tests cover aconnect()call from an$effect, delays that double up to the maximum, and a clean close.bun testloads.svelte.tsmodules through a small preload (frontend/test/svelte-plugin.js) that runs the Svelte compiler.bun run testpasses--conditions browserso that Svelte loads its client build. This adds@types/bunas a dev dependency.Verification
Ran the built app (the stack tip with the frontend embedded) in a real browser against a real server with auth on:
/browse. Reload restores the session. Logout returns to/login. Unauthenticated/browseredirects to/login.?q=) all update the URL and the list.chunk_size_mb: 3(this also covers PR 2). The stored file's SHA-256 matched.job_updateframes, going from running to completed at 100%, and the copied file matched.Not tested: drag-and-drop upload, the preview modal, share dialogs, the wallpaper picker, the 14-minute token refresh and the "session expired" path, keyboard shortcuts and multi-select,
--devmode (it fails at startup onmaster, see below), and browsers other than Chromium.With the
untrackline removed, the effect test fails witheffect_update_depth_exceeded. With it, all 7 frontend tests pass.bun run check,lint,testandbuildpass, andbun install --frozen-lockfileaccepts the lockfile.--devmode already fails onmaster:main.gohashes the dev password atbcrypt.MinCost, and config validation requires cost 10 or more. This PR does not change it.Stack: 5 of 6. Targets the branch of the PR below it.
Written by anthropic/claude-sonnet-5-5 in the Hoplite agent harness.