Closed Bug 820294 Opened 12 years ago Closed 6 years ago

media db dialog appears 7 times asking for permission

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
major

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: gerardooscarjt, Unassigned)

Details

(Keywords: b2g-testdriver)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11

Steps to reproduce:

I use 'media db' to store image, audio and video in the mobile device.


Actual results:

A dialog appears 7 times asking for permission although permissions settings was 'Grant' or 'Ask'


Expected results:

Fail at permission management
Severity: normal → major
Keywords: b2g-testdriver
Priority: -- → P3
Needs more information.

Is this device storage related? What JS code are you running?
Flags: needinfo?(gerardooscarjt)
Yes, device-storage is related.

The problem is when MediaDB is used.


==== Manifest fragment ====
  "permissions": {
    "systemXHR":{},
    "device-storage:pictures":{ "access": "write" },
    "device-storage:music":{ "access": "write" },
    "device-storage:videos":{ "access": "write" }
  }

==== Using MediaDB ====
var xhr = new XMLHttpRequest({mozSystem:true});
xhr.open('GET', that.url);
xhr.responseType = 'blob';
xhr.onreadystatechange = function(event) {
	if (xhr.readyState == XMLHttpRequest.DONE) {
		if (xhr.status == 200) {
			var imagedb = new MediaDB('pictures');
			imagedb.onready = function() {
				imagedb.addFile(that.model.name, xhr.response);
			};
		} else {
			alert('Download failed');
		}
	}
};
xhr.send();
Flags: needinfo?(gerardooscarjt)
Summary: media db → media db dialog appears 7 times asking for permission
Component: General → DOM: Device Interfaces
Flags: needinfo?(doug.turner)
Priority: P3 → --
Product: Boot2Gecko → Core
Version: unspecified → Trunk
Let's see what Doug thinks on this bug.
Gerardo,
Does the problem happen if you request { "access": "readwrite" } ?
Flags: needinfo?(doug.turner) → needinfo?(gerardooscarjt)
If I request { "access": "readwrite" } it does not work (It does not show confirm nor save the file)
Flags: needinfo?(gerardooscarjt)
gregor, any idea what might be going on?
I would have to run the code in order to test this. Maybe 811026 solves this issue but I am not sure.
FxOS/Gonk has been removed from the codebase. Mass-invalidating FxOS related Device Interface bugs to clean up the component. 

If I incorrectly invalidated something, please let me know.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Bulk correction of resolution of B2G bugs to INCOMPLETE.
Resolution: INVALID → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.