Repository navigation
fix(ui): stop Svelte 5 $effect API fetch loop and simplify Records alias column - #7
Merged
Merged
Conversation
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
Stop Continuous API Fetch Loop (
$effectReactive Tracking Bug)asyncloader directly inside$effect(() => { app.dataVersion; load(false); })executes the synchronous prelude before the firstawaitinside the effect's tracking context. Six views (Overview,Records,DDNS,Webhooks,Touch,Settings) read$state(!data,!records.length,!rules.length,!webhooks.length,!items.length,!savedSettings/!secrets.length/!sessions.length) beforeawait, then assigned freshly fetched objects/arrays to those same$statevariables, re-triggering$effectcontinuously in an infinite loop.untrack(() => ...)across all 6 affected views and defensively hardenedAccessLog,AuditLog,RecordDrawer, andApp.dataVersion), on filter/page/range changes, or via manual Refresh.Clean Up Alias Display on Records Page
→ member1, member2subtitle under the IAM Name column inRecords.svelte; alias members remain accessible with clickable links inRecordDrawerand filterable viamember:.Regression Tests
ui/src/lib/viewEffects.test.jsusing Svelte 5's compiler/parser AST to verify all data-loading$effectblocks wrap async loader calls inuntrack(), and that the Records table row header omits alias members whileRecordDrawerkeeps them.Verification
pnpm --dir ui run check:27/27tests pass + Vite dev build clean (0Svelte compiler warnings across all 10 edited components).pnpm --dir ui run build: production bundle built cleanly.golangci-lint run:0 issues.go test -count=1 -race -cover ./...: all 6 packages pass.CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o who .: clean static binary build.