userflow / userflow.js

Async loader for Userflow.js
https://userflow.com
MIT License
7 stars 2 forks source link

`history.replaceState` infinite loop #10

Closed bredfield closed 12 months ago

bredfield commented 1 year ago

We've run into the following issue multiple times with a specific user:

SecurityError: Attempt to use history.replaceState() more than 100 times per 30 seconds

Some detail:

message: "Attempt to use history.replaceState() more than 100 times per 30 seconds"
name: "SecurityError"
stack: "replaceState@[native code]
@https://js.userflow.com/es2020/userflow.js:1:10230
@https://cdn.lr-ingest.com/logger-1.min.js:1:230997
...
line: 1
column: 10230
sourceURL: "https://js.userflow.com/es2020/userflow.js"

This was encountered on Safari v. 16.5.1.

I'm unable to recreate myself -- any insight would be much appreciated!

sebastianseilund commented 1 year ago

Hi @bredfield,

We use history.replaceState() when the URL contains a ?userflow=<flow_id> query parameter to automatically start that flow, and then remove the ?userflow parameter (for beauty's sake and to avoid starting it multiple times).

Hmmm... if this is just a single specific user and you can't reproduce it, it's gonna be a tough one. First thing that comes to mind is they have a Chrome extension installed that hijacks history.replaceState() such that it doesn't work properly anymore (e.g. such that the ?userflow query param is not properly removed).

Have you been in contact with this user?

sebastianseilund commented 12 months ago

Hi @bredfield . Closing here since we didn't hear back from you. Feel free to write us again here or at support@userflow.com if this is still an issue :)