mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5799] [MERGED] fix(desktop): use store dir for unified store path #5356
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5356
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5799
Author: @CuriousCorrelation
Created: 1/23/2026
Status: ✅ Merged
Merged: 1/23/2026
Merged by: @jamesgeorge007
Base:
next← Head:fix-desktop-redirect-reads-to-correct-store📝 Commits (1)
843154ffix(desktop): use store dir for unified store path📊 Changes
1 file changed (+3 additions, -3 deletions)
View changed files
📝
packages/hoppscotch-desktop/src/kernel/store.ts(+3 -3)📄 Description
The desktop shell was reading from
instance/hoppscotch-unified.storewhile the webapp writes to
store/hoppscotch-unified.store. This causedthe app to lose track of the last connected instance on restart.
Closes FE-1121
Closes #5798
Regression source
PR #5259 (
feat(desktop): portable phase-1 foundational) introduced bothhoppscotch-desktop/src/kernel/store.tsandhoppscotch-selfhost-web/src/kernel/store.tsusinggetInstanceDir()consistently, following the FE-937 design where
instance/was intendedfor kernel store files containing connection state, recent instances, etc.
PR #5747 (
perf(desktop): cache store path resolution) changedselfhost-web from
getInstanceDir()togetStoreDir()but did notupdate the desktop shell, introducing the path mismatch:
Desktop shell:
{config}/latest/instance/hoppscotch-unified.storeWebapp:
{config}/latest/store/hoppscotch-unified.storeWhen the user switches instances in the webapp, state saves to
store/.On restart, the desktop shell reads from
instance/and finds stale ordefault state.
Why this was hard to reproduce
The bug only manifests reliably on fresh installs. On existing machines,
the migration service (
CURRENT_STORE_VERSION = 1inInstanceStoreMigrationService) has already run and won't run againsince the version check passes.
The migration reads from legacy stores (
hopp.store.json,hoppscotch-desktop.store) and writes to the kernel store. Since thedesktop shell uses
instance/path, migrated data goes there. Aftermigration completes, the webapp writes to
store/but migration neverreruns, leaving stale data in
instance/that the desktop shell readson startup.
On existing machines, working data from before the path divergence was
introduced, or the timing of instance connections relative to migrations,
might mean data happened to be in sync coincidentally.
What's changed
Changed
getInstanceDir()togetStoreDir()in the desktop shell'sstore path resolution to match #5747's change to selfhost-web:
to now
No migration needed, no data loss since user data is already in
store/.Follow-up
A subsequent PR will restore the original FE-937 design by moving both
components back to
getInstanceDir()with proper migration handling.Summary by cubic
Point the desktop shell to the unified store directory used by the webapp, so it correctly restores the last connected instance on restart. Fixes FE-1121.
Written for commit
843154f9b5. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.