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

[state] store actual state value in session storage #8022

Merged
merged 12 commits into from
Sep 7, 2016

Commits on Sep 6, 2016

  1. [state] store url states into session storage

    Kibana currently stores it's entire application state in the URL by rison encoding it and sticking it into a query string parameter, _a for AppState and _g for GlobalState.
    
    This has functioned fine for a while, but Internet Explorer's short URL length restriction are starting to become a problem for more and more users. To provide these users with a workaround this adds an advanced config option that will store the state in sessionStorage instead of the URL.
    
    This is accomplished by hashing the serialized version of the state, storing a short version of the hash in the URL, and storing the whole serialized state in sessionStorage using the hash + state-type as a key.
    
    Since sessionStorage is limited in size, we must clean up old stored states after they become unreachable to the application. This is done using the new `LazyLruStore` class, a wrapper around sessionStorage. This wrapper helps us maintain the list of stored states based on the time they are accessed (On each set the access time is updates).
    
    It's cleanup style is configured with it's maxItems, idealClearRatio, and maxIdealClearPercent configurations. The defaults for which should be sufficient.
    
    `maxItems`: limits the store to n items, removing the oldest item when the list overflows
    `idealClearRatio+maxIdealClearPercent`: when `store.setItem(key, value)` throws an error we try to clear space equal to `idealClearRatio * (key+value).length`, but no more space than `totalSize * maxIdealClearPercent`
    spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    8f7af7d View commit details
    Browse the repository at this point in the history
  2. Refactor state-hashing files into state_hashing and state_storage sub…

    …directories.
    cjcenizal authored and spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    55a923d View commit details
    Browse the repository at this point in the history
  3. Export HashingStore and LazyLruStore from index module.

    cjcenizal authored and spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    df8e5ac View commit details
    Browse the repository at this point in the history
  4. [share] stop caching unhashUrl() call

    spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    ed12206 View commit details
    Browse the repository at this point in the history
  5. Rename HashingStore interface methods for consistency and clarity. Re…

    …move unused '#remove' method.
    cjcenizal authored and spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    b51b5cb View commit details
    Browse the repository at this point in the history
  6. Simplify HashingStore interface. Extract createHash method into a cre…

    …ateStorageHash module.
    cjcenizal authored and spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    df2c116 View commit details
    Browse the repository at this point in the history
  7. Remove LazyLruStore, HashingStore, and createStorageHash.

    - Replace with HashedItemStore, createStateHash, and isStateHash.
    - Refactor stubBrowserStorage.
    cjcenizal authored and spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    06ed933 View commit details
    Browse the repository at this point in the history
  8. incorporate feedback from @thomasneirynck

    spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    6f9c708 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    445ceba View commit details
    Browse the repository at this point in the history
  10. [crypto] add license from sha.js

    spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    a26b850 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'master' of github.com:elastic/kibana into implement/sto…

    …reStateInLocalstorage
    spalger committed Sep 6, 2016
    Configuration menu
    Copy the full SHA
    bf35d8a View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2016

  1. [state] disable saving to sessionStorage by default

    Rather than enable a behavior we would rather not keep by default, we'll keep it opt-in and link to it so that users who have issues can find the setting
    spalger committed Sep 7, 2016
    Configuration menu
    Copy the full SHA
    458630d View commit details
    Browse the repository at this point in the history