MaximVanhove / vue-router-back-button

Add a back button to your application
MIT License
66 stars 9 forks source link

history.length having a maximum value of 50 causing issues #16

Closed mikemellor11 closed 2 years ago

mikemellor11 commented 2 years ago

Difficult to replicate with a failing test case as it doesn't seem jest/puppetteer has this same limitation but in the latest chrome and firefox when you get to 50 routes navigated too the length of window.history.length will always be 50 from then on. This then means the push method in this library no longer pushes anything to the session storage as the check for previousBrowserHistoryLength against window.history.length will always return true

        // Check if history length has changed since last push
        // We asume the replace function was called when not
        if (this._previousBrowserHistoryLength === window.history.length) {
            return;
        }

https://www.geeksforgeeks.org/html-dom-history-length-property/#:~:text=The%20History%20length%20property%20in,can%20be%20displayed%20in%2050.

MaximVanhove commented 2 years ago

Hmm this may cause issues. I would need to find a different way to check if a push happend

MaximVanhove commented 2 years ago

Might be fixed in c6544c070d00907e87c1113ad01025fdcdfe1e34

Will test later.

MaximVanhove commented 2 years ago

Fixed and published in v1.3.1

mikemellor11 commented 2 years ago

Looks to be working perfectly, thanks for the fast response.