Skip to content

Input buffer locked due to Location/History API throttling

Description

Changes to the input buffer fail when exceeding the browser's Location/History API rate limits.

tree.nathanfriend.com serializes the app state in the URL as a query parameter. Whenever this state changes (i.e. when rendering options + the input buffer change), the URL is updated with the new state.

Here's an example from just typing asdf repeatedly.

tree_bug

Environment

  • tree.nathanfriend.com commit
  • Operating system
    • Linux (NixOS)
  • Browser
    • Firefox 134.0.1

Potential Fix

Default the app to stop persisting state in the URL and only store it in localStorage.

Only the Share button should create a URL with the state serialized as a query parameter.

If a new instance of the app is opened with the query parameter populated:

  1. Read + validate the state from the query parameter into memory.
  2. Remove the state from the URL (i.e. update location to https://tree.nathanfriend.com).
  3. Load the state into localStorage.
    1. Provide a confirmation prompt if this will replace existing non-equal state.
Edited by Kevin Su