Skip to content

Cancel previous nav data fetching#1100

Merged
Rokt33r merged 1 commit intomasterfrom
fix/cancel-nav-data
Aug 19, 2021
Merged

Cancel previous nav data fetching#1100
Rokt33r merged 1 commit intomasterfrom
fix/cancel-nav-data

Conversation

@Rokt33r
Copy link
Copy Markdown
Member

@Rokt33r Rokt33r commented Aug 19, 2021

  • 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.

@Rokt33r Rokt33r merged commit f4c33d7 into master Aug 19, 2021
@Rokt33r Rokt33r deleted the fix/cancel-nav-data branch August 19, 2021 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant