Skip to content

Commit 8e8d407

Browse files
ryan-williamsclaude
andcommitted
Fix async-dependent URL param decoding race condition
Update `@rdub/use-url-params` to version that tracks param object identity in its cache, fixing issue where `deviceIdsParam` would cache decoded value from empty devices array and not update when devices loaded. Also suppress "Unknown device" warning during initial load when devices haven't been fetched yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 43469e6 commit 8e8d407

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@fortawesome/fontawesome-free": "^6.7.2",
2626
"@observablehq/plot": "^0.6.17",
2727
"@rdub/use-hotkeys": "github:runsascoded/use-hotkeys#79dfcfeb6721981e8a4ba20a04d56bb9a990b624",
28-
"@rdub/use-url-params": "github:runsascoded/use-url-params#79ff66b3acaedd5064f4dc39e2e4d8ede41496c7",
28+
"@rdub/use-url-params": "github:runsascoded/use-url-params#b2fd5e270c7b369ec8e674b8264fc81476f8b70b",
2929
"@tanstack/react-query": "^5.83.0",
3030
"d3": "^7.9.0",
3131
"hyparquet": "github:runsascoded/hyparquet#531d1f19f6c3224271418f6d73efb3d3fdb2f613",

www/pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/src/lib/urlParams.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ function findDeviceByPattern(pattern: string, devices: Device[]): number | null
6464
console.warn(`Ambiguous device pattern "${pattern}" matches: ${nameMatches.map(d => d.name).join(', ')}`)
6565
return null
6666
} else {
67-
console.warn(`Unknown device: ${pattern}`)
67+
// Only warn if devices have loaded (not during initial empty state)
68+
if (devices.length > 0) {
69+
console.warn(`Unknown device: ${pattern}`)
70+
}
6871
return null
6972
}
7073
}

0 commit comments

Comments
 (0)