Closed
Bug 974035
Opened 11 years ago
Closed 11 years ago
Only sync home provider data when dataset is used in an installed panel
Categories
(Firefox for Android Graveyard :: Data Providers, defect, P2)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 978991
People
(Reporter: Margaret, Assigned: Margaret)
References
Details
Instead of encouraging add-ons to only sync their data when the user has actually installed their panel (we would need to build some API for them to know this), we should find a way to do that for them through the HomeProvider.requestSync and addPeriodicSync methods.
Right now HomeProvider.jsm doesn't know anything about panels or UI, and it would be nice to keep it that way, so we should come up with a way to abstract this away. For example, maybe HomeProvider could just ask HomeConfig for the set of datasets being used in the UI.
Thoughts?
Comment 1•11 years ago
|
||
Quick (rough) idea: change HomePager to send a message to gecko (HomePanels:ActiveDatasets?) with the list of active datasets whenever it (re-)loads HomeConfig. HomeStorage would listen to this message and only sync these active datasets. The caveat of this approach is that HomePager might not be loaded if you start Fennec from an external link.
Assignee | ||
Updated•11 years ago
|
Priority: -- → P1
Assignee | ||
Comment 2•11 years ago
|
||
I forgot about this bug when recently commenting in bug 978991. In that bug, I proposed that we notify Home.panels consumers of when their panels are installed to let them sync their data.
The approach proposed in this bug is nice because add-ons can just call HomeProvider.addPeriodicSync and forget about it. However, if we go with the approach here, we should probably force a sync when a panel is installed, in order to make sure there's data available.
I also think that if we go with the "let us handle it for you" approach here, we should also just clear the data ourselves when the panel is uninstalled.
On the one hand, the add-on hook idea in bug 978991 is nice because it gives add-ons more control, but on the other hand, it might be nice to control things ourselves, and avoid exposing more APIs to add-ons.
Assignee: nobody → margaret.leibovic
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to :Margaret Leibovic from comment #2)
> I also think that if we go with the "let us handle it for you" approach
> here, we should also just clear the data ourselves when the panel is
> uninstalled.
One potential problem here is that the same dataset could be used in multiple views, so we would need to be careful to only delete the data if it isn't used in any installed panel.
Assignee | ||
Updated•11 years ago
|
Priority: P1 → P2
Assignee | ||
Comment 4•11 years ago
|
||
I'm going to dupe this to bug 978991, since I think the best way to solve this issue is to just let the add-on be in charge of knowing when its panel is installed or uninstalled, and sync its data appropriately. I think this is a better approach than making HomeProvider worry about whether or not datasets are showing in panels, since it's nice that right now it doesn't know anything about how the data its storing is being used.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 5•11 years ago
|
||
Setting P2 hub bugs to block hub v2 EPIC bug (targeting fx31 release).
Filter on epic-hub-bugs.
Blocks: 1014030
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•