anchor.diff:    }
   }
   
  -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;
  +  /// Insert this item into the [pending] list, returning whether the item was
  +  /// actually added.
  +  ///
  +  /// Some items may want to look at the current state of the work queue for
  +  /// optimization purposes. For instance:
  +  ///
  +  ///  - if two writes to the same file are scheduled, they can be merged into
  +  ///    a single transaction for efficiency.
  +  ///  - if a file creation or writes are followed by inserting a delete request
  +  ///    to the same file, previous items can be deleted from the queue.
  +  bool insertInto(LinkedList<_IndexedDbWorkItem> pending) {
  +    pending.add(this);
  +    return true;
  +  }
   
     FutureOr<void> run();
   }
  
positive.code:   _WriteFileWorkItem(this.fileSystem, this.path, this.originalContent);
  
    @override
    _WorkSimplicationResult mergeWith(_IndexedDbWorkItem other) {
      if (other is _WriteFileWorkItem) {
        if (other.path == path) {
          other.writes.addAll(writes);
          return _WorkSimplicationResult.mergedInto;
        } else {
          return _WorkSimplicationResult.lookFurther;
        }
      } else if (other is _CreateFileWorkItem) {
        return other.path == path
            ? _WorkSimplicationResult.cannotSimplify
            : _WorkSimplicationResult.lookFurther;
      }
  
      return _WorkSimplicationResult.cannotSimplify;
    }
  
    @override
  
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
  