[PR #4594] [MERGED] HSB-505 feat: user history disabling #4863

Closed
opened 2026-03-17 02:21:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4594
Author: @mirarifhasan
Created: 12/5/2024
Status: Merged
Merged: 12/16/2024
Merged by: @jamesgeorge007

Base: patchHead: feat/user-history-disabling


📝 Commits (8)

  • 8799e4d feat: user history toggle mutation and subscription added
  • 25ee396 feat: user history all delete mutation and subscription added
  • abf43df feat: query for app to get user history status
  • 5d6d3a3 test: fix failing unit test
  • 6db556d test: add unit tests for functions
  • 1495893 chore: user history deletion failed condition check added
  • 894e2e1 chore: user history feature flag guard added
  • 5ce5cbc chore: feedback resolve

📊 Changes

18 files changed (+301 additions, -20 deletions)

View changed files

📝 packages/hoppscotch-backend/src/admin/admin.module.ts (+2 -0)
📝 packages/hoppscotch-backend/src/admin/admin.resolver.ts (+12 -3)
📝 packages/hoppscotch-backend/src/admin/admin.service.spec.ts (+14 -0)
📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+13 -0)
📝 packages/hoppscotch-backend/src/admin/infra.resolver.ts (+24 -7)
📝 packages/hoppscotch-backend/src/errors.ts (+13 -1)
📝 packages/hoppscotch-backend/src/infra-config/helper.ts (+6 -0)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.module.ts (+2 -1)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.resolver.ts (+41 -2)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.service.spec.ts (+60 -0)
📝 packages/hoppscotch-backend/src/infra-config/infra-config.service.ts (+32 -0)
📝 packages/hoppscotch-backend/src/pubsub/topicsDefs.ts (+5 -4)
📝 packages/hoppscotch-backend/src/types/InfraConfig.ts (+2 -0)
packages/hoppscotch-backend/src/user-history/user-history-feature-flag.guard.ts (+21 -0)
📝 packages/hoppscotch-backend/src/user-history/user-history.module.ts (+2 -1)
📝 packages/hoppscotch-backend/src/user-history/user-history.resolver.ts (+12 -1)
📝 packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts (+24 -0)
📝 packages/hoppscotch-backend/src/user-history/user-history.service.ts (+16 -0)

📄 Description

Closes HSB-505

What's changed

This backend PR adds the ability to turn off User History feature from the Admin Dashboard.
Additionally, admin can delete all user's history with one click.

Queries/Mutations for Admin Dashboard

# Enable/Disable user history feature
mutation {
  toggleUserHistoryStore(status: DISABLE) # This mutation has a subscription for App
}
query {
  infraConfigs(configNames:[USER_HISTORY_STORE_ENABLED]){
    name
    value
  }
}

# Delete all user history
mutation {
  revokeAllUserHistoryByAdmin # This mutation has a subscription for App
}

Queries/Subscriptions for App

query {
  isUserHistoryEnabled {
    name
    value
  }
}
subscription {
  infraConfigUpdate(configName:USER_HISTORY_STORE_ENABLED)
}

subscription {
  userHistoryAllDeleted
}

Notes to reviewers

Nil


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4594 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 12/5/2024 **Status:** ✅ Merged **Merged:** 12/16/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `feat/user-history-disabling` --- ### 📝 Commits (8) - [`8799e4d`](https://github.com/hoppscotch/hoppscotch/commit/8799e4d783a5d3a9edf8e94143f3ac6493872d78) feat: user history toggle mutation and subscription added - [`25ee396`](https://github.com/hoppscotch/hoppscotch/commit/25ee396d425bd18be6384f1a599fc2c980311b26) feat: user history all delete mutation and subscription added - [`abf43df`](https://github.com/hoppscotch/hoppscotch/commit/abf43df9f20b798fe8e1d78a9df0d3d3c0f0600a) feat: query for app to get user history status - [`5d6d3a3`](https://github.com/hoppscotch/hoppscotch/commit/5d6d3a3863d5c3d17046dae098f2958e057d5155) test: fix failing unit test - [`6db556d`](https://github.com/hoppscotch/hoppscotch/commit/6db556dcece449037c030f8cab013464ba769083) test: add unit tests for functions - [`1495893`](https://github.com/hoppscotch/hoppscotch/commit/1495893658f2bd910339165ad37ea8115ead26b6) chore: user history deletion failed condition check added - [`894e2e1`](https://github.com/hoppscotch/hoppscotch/commit/894e2e1e1e3ac9fa67e1f4f3fbbce8a096949b1a) chore: user history feature flag guard added - [`5ce5cbc`](https://github.com/hoppscotch/hoppscotch/commit/5ce5cbc40d01f70c278a77f877a7f9c0fcd4c6d8) chore: feedback resolve ### 📊 Changes **18 files changed** (+301 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/admin/admin.module.ts` (+2 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.resolver.ts` (+12 -3) 📝 `packages/hoppscotch-backend/src/admin/admin.service.spec.ts` (+14 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+13 -0) 📝 `packages/hoppscotch-backend/src/admin/infra.resolver.ts` (+24 -7) 📝 `packages/hoppscotch-backend/src/errors.ts` (+13 -1) 📝 `packages/hoppscotch-backend/src/infra-config/helper.ts` (+6 -0) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.module.ts` (+2 -1) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.resolver.ts` (+41 -2) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.service.spec.ts` (+60 -0) 📝 `packages/hoppscotch-backend/src/infra-config/infra-config.service.ts` (+32 -0) 📝 `packages/hoppscotch-backend/src/pubsub/topicsDefs.ts` (+5 -4) 📝 `packages/hoppscotch-backend/src/types/InfraConfig.ts` (+2 -0) ➕ `packages/hoppscotch-backend/src/user-history/user-history-feature-flag.guard.ts` (+21 -0) 📝 `packages/hoppscotch-backend/src/user-history/user-history.module.ts` (+2 -1) 📝 `packages/hoppscotch-backend/src/user-history/user-history.resolver.ts` (+12 -1) 📝 `packages/hoppscotch-backend/src/user-history/user-history.service.spec.ts` (+24 -0) 📝 `packages/hoppscotch-backend/src/user-history/user-history.service.ts` (+16 -0) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes HSB-505 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed <!-- Describe point by point the different things you have changed in this PR --> This backend PR adds the ability to turn off `User History` feature from the Admin Dashboard. Additionally, admin can delete all user's history with one click. Queries/Mutations for Admin Dashboard ```gql # Enable/Disable user history feature mutation { toggleUserHistoryStore(status: DISABLE) # This mutation has a subscription for App } query { infraConfigs(configNames:[USER_HISTORY_STORE_ENABLED]){ name value } } # Delete all user history mutation { revokeAllUserHistoryByAdmin # This mutation has a subscription for App } ``` Queries/Subscriptions for App ```gql query { isUserHistoryEnabled { name value } } subscription { infraConfigUpdate(configName:USER_HISTORY_STORE_ENABLED) } subscription { userHistoryAllDeleted } ``` <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> Nil --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:21:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4863
No description provided.