[PR #5428] [MERGED] refactor: cleanup sync logic and imports #5198

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5428
Author: @Prit1912
Created: 10/2/2025
Status: Merged
Merged: 10/8/2025
Merged by: @jamesgeorge007

Base: nextHead: fix/letmecheck/code-refactoring-recursivelySyncCollections


📝 Commits (3)

  • 83f30ce Removed always truthy condition from recursivelySyncCollections function
  • b913774 Removed always truthy condition of parentCollectionId
  • ff33630 Removed duplicated imports

📊 Changes

33 files changed (+71 additions, -110 deletions)

View changed files

📝 packages/hoppscotch-backend/src/pubsub/pubsub.service.ts (+1 -2)
📝 packages/hoppscotch-backend/src/team-collection/team-collection.service.ts (+1 -1)
📝 packages/hoppscotch-backend/src/user/user.service.ts (+1 -1)
📝 packages/hoppscotch-cli/src/utils/pre-request.ts (+1 -2)
📝 packages/hoppscotch-common/src/helpers/actions.ts (+1 -2)
📝 packages/hoppscotch-common/src/helpers/import-export/import/hopp.ts (+2 -2)
📝 packages/hoppscotch-common/src/newstore/collections.ts (+1 -1)
📝 packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts (+1 -2)
📝 packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts (+1 -2)
📝 packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts (+7 -6)
📝 packages/hoppscotch-common/src/services/current-environment-value.service.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/inspection/index.ts (+1 -2)
📝 packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts (+1 -2)
📝 packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/persistence/index.ts (+1 -2)
📝 packages/hoppscotch-common/src/services/secret-environment.service.ts (+1 -2)
📝 packages/hoppscotch-data/src/rest/v/15/auth.ts (+4 -2)
📝 packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.sync.ts (+6 -9)
📝 packages/hoppscotch-selfhost-desktop/src/platform/collections/gqlCollections.sync.ts (+6 -9)
📝 packages/hoppscotch-selfhost-desktop/src/platform/environments/environments.sync.ts (+1 -2)

...and 13 more files

📄 Description

This PR refactors the sync logic for collections, environments, history, and settings by removing always-truthy conditions from the recursivelySyncCollections function and similar patterns. It also cleans up redundant imports across affected files.

What's changed

  • Refactored recursivelySyncCollections and related sync functions to remove unnecessary always-truthy checks.
  • Cleaned up redundant imports in sync files for desktop and web self-host platforms.
  • Ensured consistent and clear logic for request creation within sync operations.

Notes to reviewers

  • No functional changes; only code clarity and maintainability improvements.
  • #5429 is fully superseded by these changes and can be closed.
  • All similar patterns across sync files have been addressed.

🔄 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/5428 **Author:** [@Prit1912](https://github.com/Prit1912) **Created:** 10/2/2025 **Status:** ✅ Merged **Merged:** 10/8/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `fix/letmecheck/code-refactoring-recursivelySyncCollections` --- ### 📝 Commits (3) - [`83f30ce`](https://github.com/hoppscotch/hoppscotch/commit/83f30ce76f3832152c946994746d6383f87fd36e) Removed always truthy condition from recursivelySyncCollections function - [`b913774`](https://github.com/hoppscotch/hoppscotch/commit/b913774b326dc2658228af8815aa7fab1861b39e) Removed always truthy condition of parentCollectionId - [`ff33630`](https://github.com/hoppscotch/hoppscotch/commit/ff3363048c9e7730a7a646b891d5a7aa0a3c8c52) Removed duplicated imports ### 📊 Changes **33 files changed** (+71 additions, -110 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/pubsub/pubsub.service.ts` (+1 -2) 📝 `packages/hoppscotch-backend/src/team-collection/team-collection.service.ts` (+1 -1) 📝 `packages/hoppscotch-backend/src/user/user.service.ts` (+1 -1) 📝 `packages/hoppscotch-cli/src/utils/pre-request.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/helpers/actions.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/hopp.ts` (+2 -2) 📝 `packages/hoppscotch-common/src/newstore/collections.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts` (+7 -6) 📝 `packages/hoppscotch-common/src/services/current-environment-value.service.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/inspection/index.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/persistence/index.ts` (+1 -2) 📝 `packages/hoppscotch-common/src/services/secret-environment.service.ts` (+1 -2) 📝 `packages/hoppscotch-data/src/rest/v/15/auth.ts` (+4 -2) 📝 `packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.sync.ts` (+6 -9) 📝 `packages/hoppscotch-selfhost-desktop/src/platform/collections/gqlCollections.sync.ts` (+6 -9) 📝 `packages/hoppscotch-selfhost-desktop/src/platform/environments/environments.sync.ts` (+1 -2) _...and 13 more files_ </details> ### 📄 Description This PR refactors the sync logic for collections, environments, history, and settings by removing always-truthy conditions from the `recursivelySyncCollections` function and similar patterns. It also cleans up redundant imports across affected files. ### What's changed - Refactored `recursivelySyncCollections` and related sync functions to remove unnecessary always-truthy checks. - Cleaned up redundant imports in sync files for desktop and web self-host platforms. - Ensured consistent and clear logic for request creation within sync operations. ### Notes to reviewers - No functional changes; only code clarity and maintainability improvements. - #5429 is fully superseded by these changes and can be closed. - All similar patterns across sync files have been addressed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:40:07 +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#5198
No description provided.