Two possible codepath problems in Gaim log indexer 1. StartWorker (member of GaimLogQueryable) checks for the existance of config_dir (which is constructed from PathFinder.HomeDir + ".gaim"). If it can't be found, it then sets an inotify watch on env variable $HOME. Who says $HOME == PathFinder.HomeDir ? :) 2. Take this scenario: StartWorker() is called, and config_dir plus log_dir both exist. **GaimLogQueryable.OnInotifyEvent is added to the Inotify.Event handler**, then ScanLogs() is called. Now take this scenario: StartWorker() is called, config_dir exists, but log_dir does not. An inotify watch is set up, waiting for log_dir. Assume that log_dir appears at some point in the future. The inotify event handler "WatchForGaim" is called, which detects the new presence of log_dir, and ScanLogs() is called. But **OnInotifyEvent was not added to the Inotify event handler** There's a difference in these two scenario's - the OnInotifyEvent handler is only "connected" in the first one and not the second. I think that WatchForGaim should call StartWorker() so that there is only one place where we have to put the "worker initialization" routines. This would also solve the problem. Index: beagled/GaimLogQueryable/GaimLogQueryable.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/GaimLogQueryable/GaimLogQueryable.cs,v retrieving revision 1.17 diff -u -B -r1.17 GaimLogQueryable.cs --- beagled/GaimLogQueryable/GaimLogQueryable.cs 18 Feb 2005 18:25:48 -0000 1.17 +++ beagled/GaimLogQueryable/GaimLogQueryable.cs 23 Feb 2005 17:42:28 -0000 @@ -55,7 +55,7 @@ if (! Directory.Exists (config_dir)) { log.Warn ("IM: {0} not found, watching for it.", config_dir); Inotify.Event += WatchForGaim; - Inotify.Watch (Environment.GetEnvironmentVariable ("HOME"), + Inotify.Watch (PathFinder.HomeDir, Inotify.EventType.CreateSubdir | Inotify.EventType.MovedFrom | Inotify.EventType.MovedTo); @@ -145,7 +145,7 @@ { // Checking to see if the Gaim config directory was created. - if (subitem == ".gaim" && path == Environment.GetEnvironmentVariable ("HOME")) { + if (subitem == ".gaim" && path == PathFinder.HomeDir) { log.Info ("IM: Found the Gaim config directory."); Inotify.Event -= WatchForGaim; StartWorker (); @@ -157,7 +157,7 @@ log.Info ("IM: Found the Gaim logs directory."); Inotify.Event -= WatchForGaim; Inotify.Ignore (path); - ScanLogs (); + StartWorker (); return; } }