B2G needs to handle IndexedDB quota prompts

RESOLVED FIXED in Firefox 21

Status

Firefox OS
General
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Assigned: Ben Turner (not reading bugmail, use the needinfo flag!))

Tracking

unspecified
B2G C4 (2jan on)
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(blocking-basecamp:+, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed)

Details

Attachments

(3 attachments, 2 obsolete attachments)

Created attachment 699071 [details] [diff] [review]
Patch, v1

Talked with everyone today and we decided that v1 can simply deny all quota increase requests. Attached patch should automatically do that.
Attachment #699071 - Flags: review?(ben)
blocking-basecamp: --- → +
Comment on attachment 699071 [details] [diff] [review]
Patch, v1

Review of attachment 699071 [details] [diff] [review]:
-----------------------------------------------------------------

::: b2g/chrome/content/shell.js
@@ +836,5 @@
>  }
>  
> +var IndexedDBPromptHelper = {
> +  _quotaPrompt: "indexedDB-quota-prompt",
> +  _quotaResponse: "indexedDB-quota-response",

r-

@@ +860,5 @@
> +    var responseTopic = this._quotaResponse;
> +
> +    setTimeout(function() {
> +      observer.observe(null, responseTopic,
> +                       Ci.nsIPermissionManager.Deny_ACTION);

r--
Created attachment 699074 [details] [diff] [review]
Patch, v1.1

Oops, s/Deny/DENY/
Assignee: nobody → bent.mozilla
Attachment #699071 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #699071 - Flags: review?(ben)
Attachment #699074 - Flags: review?(ben)
This patch works, but fabrice wants us to do a real prompt rather than deny automatically. Over to Dale for that :)
Assignee: bent.mozilla → dale
Attachment #699074 - Flags: review?(ben)
Component: Gaia::Browser → Gaia::System
QA Contact: nhirata.bugzilla
Ok, nevermind, we're going with this for v1.
Assignee: dale → bent.mozilla
Attachment #699074 - Flags: review?(fabrice)
Created attachment 699610 [details] [diff] [review]
WIP for idb prompts - Gecko

Backing up for when we want to implement prompts
Created attachment 699612 [details] [diff] [review]
WIP for idb prompts - Gaia

Backing up for when we implement prompts
Comment on attachment 699074 [details] [diff] [review]
Patch, v1.1

Review of attachment 699074 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with s/var/let
Attachment #699074 - Flags: review?(fabrice) → review+
Created attachment 699837 [details] [diff] [review]
Deny requests for more indexedDB quota from content

I just addressed the nits and formatted the ptach for checkin
Attachment #699074 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/08c6579a454b
Keywords: checkin-needed
Component: Gaia::System → General
https://hg.mozilla.org/mozilla-central/rev/08c6579a454b
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
https://hg.mozilla.org/releases/mozilla-b2g18/rev/c5cd0da334fd
status-b2g18: --- → fixed
status-firefox19: --- → wontfix
status-firefox20: --- → wontfix
status-firefox21: --- → fixed
Target Milestone: --- → B2G C4 (2jan on)

Comment 12

4 years ago
Was there ever a follow-up filed to implement the real prompt for IDB quota increase?
(In reply to Ben Kelly [:bkelly] from comment #12)
> Was there ever a follow-up filed to implement the real prompt for IDB quota
> increase?

Looks like no. Any app can opt-in to unlimited indexedDB with the "storage" permission (even non privileged ones). So we only limit web sites.
Correct for B2G. Web sites are never allowed to go beyond their first quota limit (it's as if the user always picks the 'deny' option). Apps are in the same boat by default unless they have the 'storage' permission as fabrice notes.

Comment 15

4 years ago
So if an app needs to work with a large IDB, they should add 'storage' to their manifest even if they don't use the storage API explicitly?  That seems a bit unintuitive to me.

See this dev-gaia thread for context:

  https://groups.google.com/forum/#!topic/mozilla.dev.gaia/5cbE9o_buhY
> Correct for B2G. Web sites are never allowed to go beyond their first quota limit (it's as if the user always picks the 'deny' option). Apps are in the same boat by default unless they have the 'storage' permission as fabrice notes.

But we should fix that right? we want more web content to 'just work' and less dependency on people to create fxos only manifests
Yes. A lot of the storage backend is being rewritten currently. Once that's done we should have an easier time getting prompts properly working on B2G.
The patch to support this seems fairly simple, opened a new bug and will try to see about getting it working for 2.1

https://bugzilla.mozilla.org/show_bug.cgi?id=1048696
You need to log in before you can comment on or make changes to this bug.