Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Infinite requests for local storage on Safari #126

Open
matteblair opened this issue Aug 31, 2017 · 2 comments
Open

Infinite requests for local storage on Safari #126

matteblair opened this issue Aug 31, 2017 · 2 comments
Assignees

Comments

@matteblair
Copy link

Encountered on macOS 10.12.6, Safari 10.1.2

To reproduce, navigate to a page in the Spelunker on Safari, following a link such as: https://whosonfirst.mapzen.com/spelunker/brands/420574927/. You must be visiting it for the first time in this browser or have cleared storage preferences for the domain (Safari -> Preferences -> Privacy -> Manage Website Data... -> mapzen.com -> Remove).

You should encounter an alert like this:
screen shot 2017-08-31 at 2 24 33 pm

If you click "Don't Allow", the alert is immediately recreated. While the alert is shown, you cannot close tabs, change settings, open a developer console, or quit Safari. The browser is locked until you agree to allow however much local storage the page needs.

I think this alert is only triggered when a page requests more than 5MB of storage, so maybe this is do to a recent change in the local storage usage? Whatever the cause, can we let the page fail in this case rather than locking the whole browser?

@thisisaaronland thisisaaronland self-assigned this Aug 31, 2017
@thisisaaronland
Copy link
Member

Hrm... yeah, the reason that's happening over and over again is because this...

https://github.com/whosonfirst/js-mapzen-whosonfirst/blob/master/src/mapzen.whosonfirst.net.js

...if fetching lots of files and not being smart about not invoking the cache/localforage hooks after they've been denied the first time.

@thisisaaronland
Copy link
Member

Check for this and disable further cache sets if true...

SQLError {code: 4, message: "there was not enough remaining storage space, or t…reached and the user declined to allow more space", UNKNOWN_ERR: 0, DATABASE_ERR: 1, VERSION_ERR: 2, …}

thisisaaronland pushed a commit that referenced this issue Aug 31, 2017
…te everything that uses localforage to use a generic WOF cache wrapper for disabling things across the board...
thisisaaronland pushed a commit that referenced this issue Sep 1, 2017
dphiffer added a commit that referenced this issue Oct 2, 2017
dphiffer added a commit that referenced this issue Oct 2, 2017
… to update everything that uses localforage to use a generic WOF cache wrapper for disabling things across the board..."

This reverts commit 04525dd.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants