Closed Bug 972098 Opened 10 years ago Closed 10 years ago

Cursors returned from the SQLiteBridge don't update when data updates

Categories

(Firefox for Android Graveyard :: Data Providers, defect, P1)

ARM
Android
defect

Tracking

(firefox30 fixed, firefox31 fixed)

RESOLVED FIXED
Firefox 31
Tracking Status
firefox30 --- fixed
firefox31 --- fixed

People

(Reporter: Margaret, Assigned: lucasr)

References

Details

Attachments

(3 files)

This poses a problem if the add-on updates its data in the background while its panel fragment is still alive. We'll also need this if we want bug 970707 to work.
Priority: -- → P1
Wes, do you have any ideas how we should go about doing this? This is something we'll want for the RSS feeds we want to ship in Fx30, especially if we want pull-to-refresh to work.
Flags: needinfo?(wjohnston)
Assignee: nobody → lucasr.at.mozilla
Comment on attachment 8391175 [details] [diff] [review]
Refresh DynamicPanels when the dataset changes (r=margaret)

I initially considered implementing this in SQLiteBridgeContentProvider somehow but the DB changes done directly from Gecko are completely unaware of content providers and their URIs. One way to approach it could be to create generic gecko messages for content provider URIs and then have SQLiteBridgeContentProvider handle those. But making HomeProvider aware of those URIs felt a bit smelly. I preferred to go with a more dataset-specific message that is handled in DynamicPanel.

I don't feel strongly about either approach. Let me know what you think.
Attachment #8391175 - Flags: review?(margaret.leibovic)
Attachment #8391174 - Flags: review?(margaret.leibovic)
Attachment #8391174 - Flags: review?(margaret.leibovic) → review+
(In reply to Lucas Rocha (:lucasr) from comment #4)
> Comment on attachment 8391175 [details] [diff] [review]
> Refresh DynamicPanels when the dataset changes (r=margaret)
> 
> I initially considered implementing this in SQLiteBridgeContentProvider
> somehow but the DB changes done directly from Gecko are completely unaware
> of content providers and their URIs. One way to approach it could be to
> create generic gecko messages for content provider URIs and then have
> SQLiteBridgeContentProvider handle those. But making HomeProvider aware of
> those URIs felt a bit smelly. I preferred to go with a more dataset-specific
> message that is handled in DynamicPanel.
> 
> I don't feel strongly about either approach. Let me know what you think.

Yeah, SQLiteBridgeContentProvider is special, so I was afraid that fixing this bug would be tricky. However, I like the approach you took here, since it solves our immediate problem without getting bogged down in trying to refactor SQLiteBridge.

This approach takes advantage of the fact that we only alter the contents of HomeProvider in the save/delete methods in HomeProvider.jsm, so we'll need to remember this if we ever decide to change that, but I don't see that changing in the near future.
Attachment #8391175 - Flags: review?(margaret.leibovic) → review+
Clearing request. I agree though, this is probably the best way to do this. We could try to install some update hooks in the db, but it actually seems best to just require consumers to do the notification themselves. That way there are ways to update without notifying as well....
Flags: needinfo?(wjohnston)
https://hg.mozilla.org/mozilla-central/rev/792df7675500
https://hg.mozilla.org/mozilla-central/rev/2243f5184140
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Can we uplift this to aurora? For my world cup add-on, I want to let the user choose a country when the install the add-on, and I want the panel to update as soon as we fetch the feed data for that country.
Flags: needinfo?(lucasr.at.mozilla)
Actually, I just realized that we'll want to uplift this if we're going to uplift bug 994734 as part of uplifting bug 976064 and bug 965622 (sigh, lots of bugs).
(In reply to :Margaret Leibovic from comment #10)
> Actually, I just realized that we'll want to uplift this if we're going to
> uplift bug 994734 as part of uplifting bug 976064 and bug 965622 (sigh, lots
> of bugs).

Yep, we'll need to uplift the whole "dataset refresh" package (bug 972098, bug 976064, bug 994734) in order to uplift bug 965622.
Flags: needinfo?(lucasr.at.mozilla)
Attached patch patch for auroraSplinter Review
Note to release managers: I'm requesting uplift for a series of Firefox Hub bugs. The main fixes we need are in bugs at the end of the series, but trying to rebase those patches proved difficult and risky, so I think we should just uplift the dependecies.

Note to sheriffs: I have a local patch series that I can land on aurora when these bugs all get approval.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): dependency for initial Firefox Hub release (promoted feed add-ons in fx30)
User impact if declined: panels won't update when data changes
Testing completed (on m-c, etc.): baked on m-c
Risk to taking this patch (and alternatives if risky): only affects dynamic panels, need an add-on to trigger this
String or IDL/UUID changes made by this patch: none
Attachment #8412220 - Flags: approval-mozilla-aurora?
Attachment #8412220 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Setting P1 hub bugs to block hub v1 EPIC bug (targeting fx30 release).

Filter on epic-hub-bugs.
Blocks: 1014025
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: