mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[PR #5832] [MERGED] fix(common): correctly load mock servers on initialization and workspace change #5372
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#5372
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/5832
Author: @anwarulislam
Created: 2/4/2026
Status: ✅ Merged
Merged: 2/5/2026
Merged by: @jamesgeorge007
Base:
patch← Head:fix/mockserver-initialization📝 Commits (5)
436005afix: refactor initialization logic to use currentUser stream3aeb7e5fix: improve mock server workspace synchronization with immediate watchf370273fix: update loading state management in mock server store and dashboard445a6bafix: simplify loading mock servers logic in workspace synchronizationb31f21cchore: cleanup📊 Changes
3 files changed (+42 additions, -17 deletions)
View changed files
📝
packages/hoppscotch-common/src/components/mockServer/MockServerDashboard.vue(+4 -1)📝
packages/hoppscotch-common/src/composables/mockServerWorkspace.ts(+19 -16)📝
packages/hoppscotch-common/src/newstore/mockServers.ts(+19 -0)📄 Description
Closes FE-1079, FE-1126.
When reloading the page on the cloud offering, mock servers were not being loaded initially because
useMockServerWorkspaceSyncchecked authentication synchronously withplatform.auth.getCurrentUser(). Since Firebase'sonAuthStateChangedis asynchronous, the auth state was null at component creation time, causing the initial mock server load to be skipped.The issue only manifested after a page reload - navigating between pages worked fine because Firebase had already finished initialization.
Also, addresses the issue with the Mock server list not respecting the active workspace.
Summary by cubic
Refactored mock server initialization to use the currentUser stream, loading only when authenticated and visible. Prevents stale data on workspace changes and reduces unnecessary loads; also adds a reliable loading state to the dashboard.
Refactors
Bug Fixes
Written for commit
b31f21cca3. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.