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

[2.x] Prefetch causes stale data to be shown after post #2017

Open
nick-potts opened this issue Oct 11, 2024 · 3 comments
Open

[2.x] Prefetch causes stale data to be shown after post #2017

nick-potts opened this issue Oct 11, 2024 · 3 comments

Comments

@nick-potts
Copy link
Contributor

nick-potts commented Oct 11, 2024

Versions:

  • @inertiajs/core version: 2.0.0-beta.1
  • @inertiajs/react version: 2.0.0-beta.1

Describe the problem:

After submitting a post request that changes the current page's data, the previous prefetch value will still be used and the user will be shown stale data.

Steps to reproduce:

Set a page to be prefetched: "/settings"
Visit "/"
Visit "/settings"
router.post('/settings/update') - this returns data that modifies the settings page data
Visit "/"
Visit "/settings" - here you'll get the data from the prefetch, not the merged props from the post.

@pedroborges
Copy link
Collaborator

This should be fixed by #2023. Please test it once beta 2 is out 😉

@RobertBoes
Copy link
Contributor

@pedroborges @reinink Any chance this could get released? I'm experiencing quite a lot of issues and I'm not sure if this is solved by #2023 since the tests there only reference deferred props. But I'm also hesitant to report an issue if it's potentially already fixed.

@nick-potts
Copy link
Contributor Author

Sadly not fixed by beta 2 @pedroborges

https://imgur.com/a/tUAzjgH

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

No branches or pull requests

3 participants