Repository navigation
fix(ui): one trail length for the bar, the store and /api/flow (#1976) - #1994
Closed
danusha2345 wants to merge 1 commit into
Closed
danusha2345 wants to merge 1 commit into
danusha2345 wants to merge 1 commit into
Conversation
…mchenry#1976) The trail store saves up to 64 hops, /api/flow read at most 24, the in-memory trail had no limit, and /api/nodes answers 60 ids per request. So "Read as flow" failed on any walk of 25 or more hops, including trails the store had just saved, and a cold load of a 61-64 hop link never got its names back. /api/flow now reads up to the store's MAX_TRAIL_HOPS. The trail keeps the same 64 hops, dropping the oldest on push and on hydrate. resolveTrailNames asks /api/nodes in batches of 60 and merges the answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks @danusha2345! Your commits here were carried into #2001 (authorship preserved), with a few follow-up changes from review, and that is now merged. Closing this one in favour of it. It will be in the next release. |
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.
Fixes #1976.
Problem
Three trail limits disagreed. The trail store saves 64 hops,
/api/flowread 24, and the in-memory trail had no limit. Separately,/api/nodesanswers 60 ids per request. As a result:resolveTrailNamessent every unnamed hop in one request, so a cold load of a 61–64 hop link never got its names.Fix
One number, the store's
MAX_TRAIL_HOPS = 64:/api/flowimports it fromtrail-store.tsinstead of keeping its own 24.pushdrops the oldest, andhydratekeeps the last 64 of a longer link. So anything on the bar can be saved and read as a flow. Theuipackage can't import server code, so the constant is repeated there with a comment pointing at the store.fetchNodeRefssends ids in batches of 60 and mergesitemsandmissing. A request of 60 or fewer is still a single call.Tests
ui-flow-api.test.ts: a 64-hop trail returns 200, and 65 hops is refused naming the 64 cap.ui-package.test.ts: 70 pushes leave the last 64 hops, and 64 unnamed hops resolve in batches of 60 and 4 with every name filled in.All three fail on
main.svelte-checkreports no errors.Full suite on this branch (Linux, Node 22, native kernel): all tests pass except the known intermittent
extraction.test.tspool-worker crash from #1779 (V8Fatal process out of memory: Zone, fixed by #1883), which also occurs onmain.🤖 Generated with Claude Code