[PR #1100] [MERGED] Cancel previous nav data fetching #1149

Closed
opened 2026-03-03 00:24:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/1100
Author: @Rokt33r
Created: 8/19/2021
Status: Merged
Merged: 8/19/2021
Merged by: @Rokt33r

Base: masterHead: fix/cancel-nav-data


📝 Commits (1)

  • d906c14 Cancel previous nav data fetching

📊 Changes

3 files changed (+23 additions, -3 deletions)

View changed files

📝 src/cloud/api/teams/docs/templates.ts (+2 -1)
📝 src/cloud/api/teams/resources/index.ts (+3 -1)
📝 src/cloud/lib/stores/nav/store.tsx (+18 -1)

📄 Description

  • Cancel previous nav data fetching by implementing an abort controller
  • Check the abort controller again after fetching and block the update if it is already aborted. It seems there is some time gap till the browser handles aborting. So data fetching might not throw any error even if aborting is called.

Current status

  • A user opens a space
  • Nav hook will fetch nav data of the space
  • The use navigate to another space before the data fetching is finished.
  • Nav hook will fetch again for the other space.
  • Now the two nav data fetchings are in race condition
    • If the first data fetching is finished first, the nav data of the first space will be shown shortly in the second space page's nav
    • If the second data fetching is finished first, the first data fetching will overwrite nav data so the nav data from the first space will be loaded and be rendered on the second space page.

🔄 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/BoostIO/BoostNote-App/pull/1100 **Author:** [@Rokt33r](https://github.com/Rokt33r) **Created:** 8/19/2021 **Status:** ✅ Merged **Merged:** 8/19/2021 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `fix/cancel-nav-data` --- ### 📝 Commits (1) - [`d906c14`](https://github.com/BoostIO/BoostNote-App/commit/d906c14b9b333cbebbad63219b7a639e62cb4d72) Cancel previous nav data fetching ### 📊 Changes **3 files changed** (+23 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/cloud/api/teams/docs/templates.ts` (+2 -1) 📝 `src/cloud/api/teams/resources/index.ts` (+3 -1) 📝 `src/cloud/lib/stores/nav/store.tsx` (+18 -1) </details> ### 📄 Description - Cancel previous nav data fetching by implementing an abort controller - Check the abort controller again after fetching and block the update if it is already aborted. It seems there is some time gap till the browser handles aborting. So data fetching might not throw any error even if aborting is called. # Current status - A user opens a space - Nav hook will fetch nav data of the space - The use navigate to another space before the data fetching is finished. - Nav hook will fetch again for the other space. - Now the two nav data fetchings are in race condition - If the first data fetching is finished first, the nav data of the first space will be shown shortly in the second space page's nav - If the second data fetching is finished first, the first data fetching will overwrite nav data so the nav data from the first space will be loaded and be rendered on the second space page. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:24:51 +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/BoostNote-App#1149
No description provided.