Create AddonManager.getAllStartupChanges()

NEW
Unassigned

Status

()

Toolkit
Add-ons Manager
6 years ago
6 years ago

People

(Reporter: gps, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Created attachment 574710 [details] [diff] [review]
Add AddonManager.getAllStartupChanges()

I'm requesting a new function on AddonManager, getAllStartupChanges().

This will simply return an object containing IDs of everything that changed during startup. e.g.

  {changed: ["id1"], installed: ["id2"}

I want this API for add-on sync and think it is better than calling getStartupChanges() for each change type because: a) less function calls b) guaranteed to iterate over every change type.

If the attachment is f+, I'll code some unit tests and submit a new patch for review. If you don't like the idea, it will make Sync code more verbose and prone to breaking, but I'll live with it.
Attachment #574710 - Flags: feedback?(bmcbride)
Comment on attachment 574710 [details] [diff] [review]
Add AddonManager.getAllStartupChanges()

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

Yea, that works. Pity the design of getStartupChanges() doesn't allow for just passing in STARTUP_CHANGE_ALL or null (like the rest of the APIs do), but oh well.
Attachment #574710 - Flags: feedback?(bmcbride) → feedback+
(Reporter)

Comment 2

6 years ago
Well, it would be trivial to add STARTUP_CHANGE_ALL to getStartupChanges(). The return type would have a different format (object instead of list), so maybe a different function is warranted. Let me know.
(In reply to Gregory Szorc [:gps] from comment #2)
> The return type would have a different format (object instead of list), so
> maybe a different function is warranted.

Yea, that's what I meant - it would require changing the return type, which I don't think is worth it since that would make the normal use of that function more cumbersome. So a new function seems like the way to go.
(Reporter)

Comment 4

6 years ago
I may not need this API depending on what happens in bug 702819. Ideally this API should be considered separately. But since I'm the only requester, I'm going to hold off and see what happens in bug 702819 before going any further.
Depends on: 702819
(Reporter)

Comment 5

6 years ago
I no longer need this for add-on sync. I'll leave it up to the Add-on Manager folks to determine what to do with it.
No longer blocks: 534956
You need to log in before you can comment on or make changes to this bug.