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

Send <head> along with pagination frames #5175

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AntonKhorev
Copy link
Collaborator

@AntonKhorev AntonKhorev commented Sep 9, 2024

Things broken by Turbo pagination part 2, the previous part is #5111.

Previous/next page visits are promoted to full page visits with Turbo rewriting most of <head> tags. If new tags aren't sent together with the updated frame, old ones will be simply deleted. That includes deleting a page title and csrf token tags, which is going to break some functionality, particularly logouts. See hotwired/turbo#1237.

Open any page with Turbo pagination, click Older/Newer link, notice that the page title is gone. Then click Logout and it's not going to work. #4646 (comment) worked correctly for changeset elements pagination because it's not promoted to page visits.

Previous/next page visits are promoted to full page visits with Turbo rewriting most of <head> tags. If new tags aren't sent together with the updated frame, old ones will be simply deleted. That includes deleting a page title and csrf token tags, which is going to break some functionality, particularly logouts.
@AntonKhorev AntonKhorev marked this pull request as draft September 10, 2024 10:51
@AntonKhorev
Copy link
Collaborator Author

Tried data-turbo-track="reload" workaround from hotwired/turbo#1237. Keeps the <head> but breaks back/forward navigation as stated in hotwired/turbo#1237 (comment).

There's one more problem with either resending <head> or adding data-turbo-track="reload". If you close the browser and reopen it and it tries to restore the session, the page will only contain the frame.

@AntonKhorev
Copy link
Collaborator Author

Duplicate tab is also broken.

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 this pull request may close these issues.

1 participant