After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 749225 - glocalfilemonitor: Send DELETED event when there is no 'other' file
glocalfilemonitor: Send DELETED event when there is no 'other' file
Status: RESOLVED DUPLICATE of bug 751731
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-05-11 13:37 UTC by Iain Lane
Modified: 2015-07-07 11:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glocalfilemonitor: Send DELETED event when there is no 'other' file (1.54 KB, patch)
2015-05-11 13:38 UTC, Iain Lane
none Details | Review

Description Iain Lane 2015-05-11 13:37:56 UTC
tracker's testsuite started failing with 2.45.1:

/libtracker-miner/tracker-monitor/file-event/moved/to-not-monitored: Tracker-Message: Monitor backend:'GInotifyFileMonitor' is unknown, we have no limits in place because we don't know what we are dealing with!
Tracker-Message: Monitor limit is 100
(/tmp/adt-run.kYQgbS/build.S9m/tracker-1.2.5/tests/libtracker-miner/.libs/lt-tracker-monitor-test:3869): Tracker-DEBUG: Added monitor for path:'file:///tmp/monitor-test-3869', total monitors:1
(/tmp/adt-run.kYQgbS/build.S9m/tracker-1.2.5/tests/libtracker-miner/.libs/lt-tracker-monitor-test:3869): Tracker-DEBUG: Waiting 5 seconds for monitor events...
(/tmp/adt-run.kYQgbS/build.S9m/tracker-1.2.5/tests/libtracker-miner/.libs/lt-tracker-monitor-test:3869): Tracker-DEBUG: Received monitor event:7 (G_FILE_MONITOR_EVENT_MOVED) for file:'file:///tmp/monitor-test-3869/created.txt'
(/tmp/adt-run.kYQgbS/build.S9m/tracker-1.2.5/tests/libtracker-miner/.libs/lt-tracker-monitor-test:3869): Tracker-DEBUG: Emitting ITEM_MOVED for (FILE) 'file:///tmp/monitor-test-3869/created.txt'->'(null)'

(/tmp/adt-run.kYQgbS/build.S9m/tracker-1.2.5/tests/libtracker-miner/.libs/lt-tracker-monitor-test:3869): GLib-GIO-CRITICAL **: g_file_get_path: assertion 'G_IS_FILE (file)' failed

...because it expects a non-null other_file with MOVED events.

Prior to 2.45, we sent a DELETED event when moving a file outside of a
monitored directory. Restore this behaviour.
Comment 1 Iain Lane 2015-05-11 13:38:01 UTC
Created attachment 303215 [details] [review]
glocalfilemonitor: Send DELETED event when there is no 'other' file

The documentation states "If using […] G_FILE_MONITOR_SEND_MOVED flag
and event_type is G_FILE_MONITOR_EVENT_MOVED, […] other_file will be set
to a GFile containing the new path. In all the other cases, other_file
will be set to NULL."

There's code in the wild which expects a non-null other_file when it
gets a MOVED event.

When moving a file outside of a monitored directory, send DELETED. This
is the pre-2.45 behaviour.
Comment 2 Iain Lane 2015-07-07 11:51:40 UTC

*** This bug has been marked as a duplicate of bug 751731 ***