Comfy-Org / Comfy-Org/ComfyUI_frontend
cleanup: call clearPreservedQuery before early return for invalid create_workspace param in useCreateWorkspaceUrlLoader
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
In `src/platform/workspace/composables/useCreateWorkspaceUrlLoader.ts`, when the `create_workspace` query parameter is present but empty or invalid (non-string), the early return on line 46 exits before `clearPreservedQuery` is called. This means the preserved query (sessionStorage) is not cleaned up, resulting in a no-op loop on subsequent loads (hydration merges it back, the same guard fires again).
The URL param itself is cleaned by the merge step, so this is low-risk — but calling `clearPreservedQuery` before the early return would be cleaner and prevent the stale sessionStorage entry.
## Follow-up Action
Before the early return guard for invalid/empty `create_workspace` values, call `clearPreservedQuery(NAMESPACE)` so the one-shot trigger is fully consumed regardless of validity.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9901
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9901#discussion_r2944311960
- Raised by: @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10213-cleanup-call-clearPreservedQuery-before-early-return-for-invalid-create_workspace-pa-3266d73d3650816bb702debbc170dcbf) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.