This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
Update Visitable.visitableURL after following a redirect #156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
When reloading a page using pull-to-refresh after visiting a URL that redirects somewhere else, the original URL is reloaded instead of the URL that was redirected to.
This is inconsistent with how Turbolinks works in a browser where the address bar is updated using the History API causing reloading the page to reload the URL that was redirected to.
This happens both for cold boot visits and JavaScript visits.
This PR is an attempt to solve this problem by having the Turbolinks WebView adapter report back the final location after loading a page (for cold boot visits) or completing a visit (for JavaScript visits).
This might be a terrible solution but maybe it can help illustrate the problem?
I've also created a minimal Rails app that can be used to test this by changing
ApplicationController.url
to point to port 3000 in the demo app:When the demo app starts it will first
GET /
that will redirect to/redirect_target
causing anotherGET
for this path.Before this PR, reloading the page using pull-to-refresh, would cause the same series of requests:
GET /
thenGET /redirect_target
.After this PR, it only causes a
GET /redirect_target
.The exact same behavior can be observed when clicking the "Go to /" link causing a JavaScript visit instead of a cold boot visit.