anchor.diff:      _checkClosed();
   
       // See if this unit of work can be combined with scheduled work units.
  -    if (_pendingWork.isNotEmpty) {
  -      _IndexedDbWorkItem? compareWith = _pendingWork.last;
  -      assert(_currentWorkItem != compareWith,
  -          'Current work item should be removed from queue');
  -
  -      while (compareWith != null) {
  -        final result = work.mergeWith(compareWith);
  -        switch (result) {
  -          case _WorkSimplicationResult.mergedInto:
  -            return compareWith.completer.future;
  -          case _WorkSimplicationResult.cannotSimplify:
  -            compareWith = null;
  -            break;
  -          case _WorkSimplicationResult.lookFurther:
  -            compareWith = compareWith.previous;
  -            break;
  -          case _WorkSimplicationResult.deletePreviousAndContinue:
  -          case _WorkSimplicationResult.deletePreviousAndMergedWith:
  -            final next = compareWith.previous;
  -            compareWith.unlink();
  -            compareWith = next;
  -
  -            if (result == _WorkSimplicationResult.deletePreviousAndMergedWith) {
  -              return next?.completer.future ?? Future.value();
  -            }
  -        }
  -      }
  -    }
  -
  -    _pendingWork.add(work);
  -    _startWorkingIfNeeded();
  -
  -    return work.completer.future;
  +    if (work.insertInto(_pendingWork)) {
  +      _startWorkingIfNeeded();
  +      return work.completer.future;
  +    } else {
  +      // This item determined that it doesn't need to do any work at its place
  +      // in the queue, so just skip it.
  +      return Future.value();
  +    }
     }
   
     Future<void> _submitWorkFunction(
  
positive.code:   }
  }
  
  enum _WorkSimplicationResult {
    cannotSimplify,
    lookFurther,
    deletePreviousAndContinue,
    deletePreviousAndMergedWith,
    mergedInto,
  }
  
  abstract class _IndexedDbWorkItem extends LinkedListEntry<_IndexedDbWorkItem> {
    final Completer<void> completer = Completer.sync();
  
    _WorkSimplicationResult mergeWith(_IndexedDbWorkItem other) =>
        _WorkSimplicationResult.cannotSimplify;
  
    FutureOr<void> run();
  }
  
negative.code:   _DeleteFileWorkItem(this.fileSystem, this.path);
  
    @override
    bool insertInto(LinkedList<_IndexedDbWorkItem> pending) {
      if (pending.isNotEmpty) {
        // Check queue from back to front and see if this delete can be merged
        // into an existing operation or if it cancels out a creation operation
        // that is pending.
        _IndexedDbWorkItem? current = pending.last;
  
        while (current != null) {
          if (current is _DeleteFileWorkItem) {
            // If there already is a pending "delete" request available, we don't
            // have to run a new one.
            if (current.path == path) {
              // File is already getting deleted, no need to do that again.
              return false;
            } else {
              // Unrelated delete request, look further
              current = current.previous;
            }
          } else if (current is _WriteFileWorkItem) {
            final previous = current.previous;
            if (current.path == path) {
              // There's a pending write to a file that we're deleting now, that
              // can be unscheduled now.
              current.unlink();
            }
  
            current = previous;
          } else if (current is _CreateFileWorkItem) {
            if (current.path == path) {
              // The creation of this file is pending. Since we're now enqueuing
              // its deletion, those two just cancel each other out.
              current.unlink();
              return false;
            }
  
            current = current.previous;
          } else {
            // Can't simplify further, we don't know what this general item is
            // doing.
            break;
          }
        }
      }
  
      pending.add(this);
      return true;
    }
  
    @override
  