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

Double fetch when starting at ParamSegment at some route belonging to ParentRoute, navigate to parent and back down #2961

Open
metatoaster opened this issue Sep 10, 2024 · 0 comments

Comments

@metatoaster
Copy link
Contributor

metatoaster commented Sep 10, 2024

Describe the bug

Initially thought to be only applicable to changes introduced in #2959, I've retested my reproduction steps below against 827cc0b (which was thought to fix everything related to #2937) and the double fetch is in fact reproducible.

I've updated the same gist once more as I've been workshopping that into a fully standalone base for the regression test I've mentioned previously.

To Reproduce
Steps to reproduce the behavior:

  1. Keep the Network developer tool open for the browser
  2. Ensure that the page is hydrated while under Target 3## (i.e. /item/3/)
  3. Navigate to Item Listing via the link to get CSR rendering
  4. Navigate to Target 4## via the link
  5. See that get_item is fetched twice.
  6. Similar behavior will occur when starting from Target 41#, navigate to Target 4##, then Target 42#, and this would double fetch inspect_item. Since the logging is instrumented more thoroughly for this component, this reproduction step may provide additional hints of what happened.
  7. This is only triggered if the parameter has changed from the initial condition, that is, starting at Target 42#, go to Target 4## then back to Target 42# will not trigger the double fetch, but once it hits Target 41# (being different to the start) then the double fetch behavior will continue until the root ParentRoute is fully unmounted (that is, going back to Home).
  8. This also only affect the same component, that is, if you start at Target 3##, then Item Listing then Target 4##, going to Target 41# will not trigger the double fetch. Navigating back to Target 3## or Target 4## will once again trigger the double fetch.
@metatoaster metatoaster changed the title Double fetch when starting at ParamSegment at some route beloning to ParentRoute, navigate to parent and back down Double fetch when starting at ParamSegment at some route belonging to ParentRoute, navigate to parent and back down Sep 10, 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

No branches or pull requests

1 participant