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

[Chrome] Custom actions execute twice #6477

Open
KDederichs opened this issue Oct 15, 2024 · 3 comments
Open

[Chrome] Custom actions execute twice #6477

KDederichs opened this issue Oct 15, 2024 · 3 comments

Comments

@KDederichs
Copy link
Contributor

Describe the bug
Ok this is gonna be a weird one:

I have an issue where custom actions execute twice but ONLY in Chrome (Firefox and Safari are fine).

To Reproduce
I tried to replicate this behavior on the local test environment but there it doesn't seem to happen, so no clue.
On Prod it does that every them when you open a custom action with Chrome.

(OPTIONAL) Additional context

I don't think it's related but the website is running on a Plesk server (the usual nginx into apache php-fpm setup)

Anyone ever experienced anything remotely similar and knows what's up with that?

@KDederichs
Copy link
Contributor Author

Looking at the webserver logs it also shows the request going out twice so I'm a bit unsure if it's a Chrome thing or an easy admin thing:
Screenshot 2024-10-15 at 15 44 42

we did test it on two different machines though and on both it's doing that (on one it's even stock Chrome freshly downloaded)

@KDederichs
Copy link
Contributor Author

Ok it might be Chrome's prefetching (it doesn't do that locally which explains why I can't reproduce it)
Does easy admin check for prefetching or does it just execute what ever is in the action when the prefetch hits? (Yes I know you aren't supposed to mutate data GET but there's not really another way with EA actions as far as I am aware)

@KDederichs
Copy link
Contributor Author

It is indeed Chrome prefetching.
By adding some code to detect this and then just return an empty page the problem is fixed.

Now the question is if we should do this by default in EasyAdmin or if possible have some config to ignore those prefetch request.

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