mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 08:45:58 +03:00
[PR #5971] feat: add option to clear local workspace data on logout #5438
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#5438
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/5971
Author: @statxc
Created: 3/10/2026
Status: 🔄 Open
Base:
main← Head:feat/clear-local-data-on-logout📝 Commits (1)
9a60e78feat: add option to clear local workspace data on logout📊 Changes
11 files changed (+266 additions, -43 deletions)
View changed files
📝
packages/hoppscotch-common/locales/en.json(+4 -0)📝
packages/hoppscotch-common/src/components/profile/index.vue(+20 -0)📝
packages/hoppscotch-common/src/newstore/settings.ts(+4 -0)📝
packages/hoppscotch-common/src/services/persistence/__tests__/index.spec.ts(+77 -0)📝
packages/hoppscotch-common/src/services/persistence/index.ts(+116 -0)📝
packages/hoppscotch-common/src/services/persistence/validation-schemas/index.ts(+2 -0)📝
packages/hoppscotch-common/src/services/tab/graphql.ts(+16 -0)📝
packages/hoppscotch-common/src/services/tab/rest.ts(+16 -0)📝
packages/hoppscotch-selfhost-web/src/platform/auth/desktop/index.ts(+6 -0)📝
packages/hoppscotch-selfhost-web/src/platform/auth/web/index.ts(+5 -2)📝
pnpm-lock.yaml(+0 -41)📄 Description
Closes #5957
What's changed
This PR adds a new privacy setting that gives users the option to clear their local workspace data when they log out.
New setting: "Clear local workspace data on logout"
A toggle has been added under Settings → Privacy. When enabled, logging out will remove the following data from the browser's localStorage:
Settings and schema version are intentionally preserved so user preferences (theme, language, etc.) remain intact across sessions.
Implementation details
CLEAR_LOCAL_DATA_ON_LOGOUTto the settings store with a default value offalseclearWorkspaceData()inPersistenceServiceto handle storage removal and in-memory state reset_isPersistencePausedflag inPersistenceServiceto prevent RxJS store subscribers from re-writing cleared data back to localStorage during logoutsignOutUser()for both selfhost-web and desktop auth flowsclearWorkspaceData(success path and partial failure handling)Notes to reviewers
_isPersistencePausedflag is necessary because resetting in-memory stores (e.g.,setRESTCollections([])) triggers persistence subscribers that would immediately re-save empty state back to localStorage. Without this flag, the cleared keys get re-created within milliseconds of removal.trueafter logout - thePersistenceServicereinitializes on the next login, so there is no need to unpause it.Summary by cubic
Adds a Privacy toggle to clear local workspace data on logout (Linear #5957). When enabled, logout wipes browser-stored workspace data while preserving user settings.
Written for commit
9a60e78761. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.