[PR #2871] [MERGED] fix: circular watcher dependencies on invite.vue causing infinite loop #4117

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2871
Author: @amk-dev
Created: 12/6/2022
Status: Merged
Merged: 12/6/2022
Merged by: @AndrewBastin

Base: mainHead: fix/infinite-loop-invite-vue


📝 Commits (1)

  • 758f576 fix: circular watcher dependencies causing infinite loop

📊 Changes

1 file changed (+16 additions, -19 deletions)

View changed files

📝 packages/hoppscotch-common/src/composables/graphql.ts (+16 -19)

📄 Description

Before

There is an infinite loop caused by two watchEffects modifying dependencies in a circular way.

  1. WatchEffect#1 modifies a dependency of WatchEffect#2
  2. WatchEffect#2 calls a function expect which modifies dependencies of WatchEffect#1
  3. WatchEffect#1 runs again, and this becomes a loop

After

We removes this circular dependency by

  1. Converting one watchEffect into a watch so we have explicit control over the reactivity, and remove tracking reactivity for source and isPaused in that watch
  2. Remove updateTicker ref which is replaced by a function

🔄 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/2871 **Author:** [@amk-dev](https://github.com/amk-dev) **Created:** 12/6/2022 **Status:** ✅ Merged **Merged:** 12/6/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `fix/infinite-loop-invite-vue` --- ### 📝 Commits (1) - [`758f576`](https://github.com/hoppscotch/hoppscotch/commit/758f576c83697265eb169988f79e6b40321c95d0) fix: circular watcher dependencies causing infinite loop ### 📊 Changes **1 file changed** (+16 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/composables/graphql.ts` (+16 -19) </details> ### 📄 Description **Before** There is an infinite loop caused by two watchEffects modifying dependencies in a circular way. 1. WatchEffect#1 modifies a dependency of WatchEffect#2 2. WatchEffect#2 calls a function `expect` which modifies dependencies of WatchEffect#1 3. WatchEffect#1 runs again, and this becomes a loop **After** We removes this circular dependency by 1. Converting one `watchEffect` into a `watch` so we have explicit control over the reactivity, and remove tracking reactivity for `source` and `isPaused` in that watch 2. Remove `updateTicker` ref which is replaced by a function --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:40:59 +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#4117
No description provided.