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

Enforce that it's the actual redirect request that get the flash data #192

Open
ia3andy opened this issue Jan 19, 2024 · 0 comments
Open

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Jan 19, 2024

I managed to reproduce a bug (consistently) that I've been experiencing for a while with htmx and flashes.

Essentially, if a request with a redirect (which flashes the htmx) occurs, and for some reason, the browser does not consume the redirect, the next request (which is unrelated) use the wrong flashed (and is returned as htmx).
The problem can also occur with errors.

I think it's essential to have a way to enforce that it's the redirect that triggers the flash (and not a different request).

I'm not sure how to best achieve that, probably a flag query in the redirect URL (?flash-id=37336464647474)?

It would have been better with a silent way to enforce it but we don't control headers of the redirect, so I don't really see any alternative.

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