There's an in-memory cache for total_rows (aka doc_count) in the IDB adapter. This is cute and has some perf benefits, but it also introduces inconsistencies between the worker thread and main thread because we're caching stuff in-memory, outside of the IDB transaction.
Given the increasing usage of web workers and service workers, I don't think this is a safe tradeoff to make anymore. We should just remove this optimization and look for other, safer optimizations.