SqlScanResultProcessor: fix stupid data-loss bug caused by my commit ca88c8d3
Commit ca88c8d3 introduced some extra logic and a member variable in order to fix bug 311078. However, I forgot to add the variable into the cleanupMembers() method, which resulted in state leaking from one scanner to another. What happened: 1. User performed full rescan. For every directory in the collection, deleteDeletedTracksAndSubdirs() was called, which essentially inserted all existing directory ids to m_scannedDirectoryIds. 2. All member variables were cleared except m_scannedDirectoryIds, which leaked into the next run. 3. A file was changed, which triggered partial update scan run with only a couple of changed directories. 4. Its deleteDeletedDirectories() method was called, which called deletedDirectories(), which used m_scannedDirectoryIds as a basis, removed just the newly scanned dirs from it and returned all the rest. 5. deleteDeletedDirectories() deleted all but newly scanned directories. 6. strohel feels ashamed. The fix is to simply clear m_scannedDirectoryIds in cleanupMembers(). In addition to fixing bug 322603, this should also minimise changes of reproducing bug 322474 (but not fixing the actual bug) BUG: 322603 CCBUG: 322474 FIXED-IN: 2.8
Loading
Please register or sign in to comment