GNOME Bugzilla – Bug 749225
glocalfilemonitor: Send DELETED event when there is no 'other' file
Last modified: 2015-07-07 11:51:40 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.
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.
*** This bug has been marked as a duplicate of bug 751731 ***