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

Fast form updates causing a "SecurityError: Attempt to use history.replaceState() more than 100" in Safari #1812

Open
duswie opened this issue Feb 28, 2024 · 0 comments

Comments

@duswie
Copy link

duswie commented Feb 28, 2024

Version:

  • @inertiajs/vue3 version: 1.0.11
  • Safari 17.2.1 on macOS 14.2.1

Describe the problem:

Fast updates of data within a remembered form created with useFrom('key, ...) are causing a Unhandled Promise Rejection: SecurityError: Attempt to use history.replaceState() more than 100 times per 10 seconds error.

Such quick updates can be made, for example, when using RangeSlider as user input.
This can of course be prevented by a rate limit before changing the form value, but I think limiting the history.replaceState() calls to avoid browser errors should be a be handled by inertia?

Seems to be limited to Safari, tested with Version 17.2.1 on macOS 14.2.1.

Steps to reproduce:

  • use Safari
  • create a form with const form = useFrom('remember_key', { fast_changing: 0 })
  • change a value in the form more than 100 times per 10 seconds, like:
setInterval(() => {
  form.fast_changing = (new Date()).getMilliseconds()
}, 5)
  • check console for Unhandled Promise Rejection: SecurityError: Attempt to use history.replaceState() more than 100 times per 10 seconds
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