Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data loader uses old route params, when navigation changes to to fast. #200

Closed
minht11 opened this issue Jul 15, 2023 · 2 comments · Fixed by #246
Closed

Data loader uses old route params, when navigation changes to to fast. #200

minht11 opened this issue Jul 15, 2023 · 2 comments · Fixed by #246
Assignees

Comments

@minht11
Copy link

minht11 commented Jul 15, 2023

Data loader uses old route params, when navigation changes to to fast.

Reproduction

  1. Go to example https://stackblitz.com/edit/vitejs-vite-xntgcq
  2. Click on link "Test 2" few times, then quickly click on link "Test 1"
  3. Observe that params from current route, and data loader mismatch.
Screen.Recording.2023-07-15.at.23.30.01.mov
@posva posva added the bug label Jul 16, 2023 — with Volta.net
Copy link
Owner

posva commented Jul 16, 2023

This might be related to #201. I think it's a mix of the current cached behavior and not properly discarding old fetching. I think adding different stages to the data, e.g. waiting for all of the loaders to be resolved before applying will help for this and #201

@posva posva self-assigned this Aug 8, 2023
posva added a commit that referenced this issue Aug 8, 2023
@posva
Copy link
Owner

posva commented Aug 14, 2023

@minht11 Some heads-up: this and other bugs are fixed but the next release will likely be a major that replaces the current implementation of defineLoader. I haven't written the changelog yet and I do hope to add deprecations in the meantime but the new fixed version does not have a cache (yet) and things like invalidate, pendingLoad, and cacheTime do not exist anymore. Ideally, I will create another define loader for cache that uses a light lru cache but I think the priority should be having a loader with no cache (since most of GET cache should be handled at server level anyway) and move from there to support other patterns and update vuejs/rfcs#460

posva added a commit that referenced this issue Nov 28, 2023
posva added a commit that referenced this issue Dec 19, 2023
ian-aguilar added a commit to ian-aguilar/unplugin-vue-router that referenced this issue Oct 4, 2024
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 a pull request may close this issue.

2 participants