Closed Bug 1580195 Opened 3 months ago Closed 3 months ago

Ignore uses of IDBFactory.open(name) in telemetry

Categories

(Core :: Storage: IndexedDB, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: sg, Assigned: sg)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

As pointed out in https://bugzilla.mozilla.org/show_bug.cgi?id=1566758#c25:
This means that we need to change the webidl (https://searchfox.org/mozilla-central/source/dom/webidl/IDBFactory.webidl#36) such that the parameter is made non-optional, and we add another overload that only accepts the first parameter, so that we can properly distinguish these cases in the code.

Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Priority: -- → P3

Unfortunately, the webidl syntax does not seem to allow this. Trying the declare IDBOpenDBRequest open(DOMString name, IDBOpenDBOptions options) yields the following error:

WebIDL.WebIDLError: error: Dictionary argument without any required fields or union argument containing such dictionary not followed by a required argument must be optional

I don't see a possibility to change this in a way these conditions are fulfilled.

We could, however, change the default value of the dictionary to contain some dummy entry that indicates that the caller did not pass any dictionary.

This does not seem to be possible either, due to https://heycam.github.io/webidl/#idl-dictionary:

However, there is no way to represent a constant dictionary value inside IDL fragments.

Then the only way is to assume, as ttung already suggested, that explicit calls with an empty dictionary are so rare, that we can ignore them completely for the telemetry.

Or is there any other feasible option?

Flags: needinfo?(shes050117)

(In reply to Simon Giesecke [:sg] [he/him] from comment #2)

This does not seem to be possible either, due to https://heycam.github.io/webidl/#idl-dictionary:

However, there is no way to represent a constant dictionary value inside IDL fragments.

Then the only way is to assume, as ttung already suggested, that explicit calls with an empty dictionary are so rare, that we can ignore them completely for the telemetry.

Or is there any other feasible option?

Not I can think of at this moment.

I guess we can assume the usage of the empty dictionary is really rare since it would throw on other browsers and take no effect on opening a database.

Flags: needinfo?(shes050117)
Keywords: checkin-needed

Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f1d229db816d
Exclude calls of open(name, {}) and open(name) from telemetry. r=ttung,asuth

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.