MTP/DeviceStorage: Cleanup up device storage file notifications

RESOLVED WONTFIX

Status

defect
RESOLVED WONTFIX
5 years ago
Last year

People

(Reporter: dhylands, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Currently device storage has a mechanism for sending notifications to interested parties that a file has changed (created, added, modified).

Since MTP can change those files, and needs to be notified when new files are added, we wind up with the potential for circular notifications.

So I'd like to propose that we add an origin to the notifications (perhaps not the change notification, but the file-watcher-update and/or file-watcher-notify)

That way, when a source of changes receives a notification which it sent (because it is both a Notifier and Observer) it can filter them out and there won't be any risk of out-of-control notifications.

Currently, we don't have a problem because MTP doesn't have to notify internal (on-the-phone) apps about changes, it only has to notify the host.

MTP currently uses logic like don't tell the host about an added file if it's already in the database, but I'd rather have the filtering be a bit more explicit.
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.