Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

compare sliced route match to determine if segment_dirty is true #691

Merged
merged 1 commit into from
May 21, 2019

Conversation

btakita
Copy link
Contributor

@btakita btakita commented May 13, 2019

Fixes #688

@btakita
Copy link
Contributor Author

btakita commented May 17, 2019

The PR seems to be working with additional tests which failed with the old implementation.

The problem was the hydrate_target was comparing the split path to the route segment, which resulted in the cached current_branch[i] erroneously being returned for spread routes.

The bug manifested as the preload on the spread route not being called due to the cached current_branch[i] being returned.

This fix checks the sliced route match array against the sliced route match array in current_branch[i].

@btakita btakita changed the title compare all segments to determine if segment_dirty is true compare sliced route match to determine if segment_dirty is true May 17, 2019
@btakita btakita force-pushed the issues/688 branch 4 times, most recently from 7e9e3d1 to ee0189f Compare May 21, 2019 03:02
…t's route match.

current_branch[i].match.slice(1, i+2) compared to match.slice(1, i+2)

Fixes sveltejs#688
@btakita
Copy link
Contributor Author

btakita commented May 21, 2019

I force pushed some formatting fixes.

@Rich-Harris Rich-Harris merged commit 5460896 into sveltejs:master May 21, 2019
@Rich-Harris
Copy link
Member

nice fix, thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigating within the same spread route changes url but page stays the same
2 participants