digraph IndexedDBBlobStateDiagram {
  graph [nodesep="0.8", ranksep="0.8"];
  node [shape=box];
  
  PutWithABlob [fontname="Courier New", label="os.put(blob, key)" shape=oval style=bold];
  UnlinkedPendingInactive
    [label=<<B>Unlinked</B>, <B>Pending</B> (Inactive)>
     color="#000099"];
  UnlinkedPendingActive
    [label=<<B>Unlinked</B>, <B>Pending</B> (Active)>
     color="#000099"];

  LinkedPersistedInactive
    [label=<<B>Linked</B>, <B>Persisted</B> (Inactive)>
     color="#009900"];
  LinkedPersistedActive
    [label=<<B>Linked</B>, <B>Persisted</B> (Active)>
     color="#009900"];

  UnlinkedPersistedActive
    [label=<<B>Unlinked</B>, <B>Persisted</B> (Active)>
     color="#999900"];
  UnlinkedPersistedInactive
    [label=<<B>Unlinked</B>, <B>Persisted</B> (Inactive)<br/>(doomed, inaccessible)>
     color="#999900"];

  Deleted [label=<<B>Deleted</B>> shape=oval style=bold];

  subgraph cluster_active {
    style="invisible"
    rank="left"
    UnlinkedPendingActive
    LinkedPersistedActive
    UnlinkedPersistedActive
  }

  subgraph cluster_inactive {
    style="invisible"
    rank="right"
    UnlinkedPendingInactive
    LinkedPersistedInactive
    UnlinkedPersistedInactive
  }

  PutWithABlob -> UnlinkedPendingInactive;
  UnlinkedPendingInactive -> LinkedPersistedInactive
      [label=<Transaction is committed.<br/>
<FONT face="Courier New">txn.commit();</FONT>>];

  UnlinkedPendingInactive -> UnlinkedPendingActive
      [label=<Get is called on the transaction.<br/>
<FONT face="courier new">let blob = os.get(key);</FONT>>];

  UnlinkedPendingActive -> UnlinkedPendingInactive
      [label=<Blob from Get is dropped.<br/>
<FONT face="Courier New">blob = null;</FONT>>];
      
  UnlinkedPendingActive -> LinkedPersistedActive
      [label=<Transaction is committed.<br/>
<FONT face="Courier New">txn.commit()</FONT>>];

  LinkedPersistedInactive -> LinkedPersistedActive
      [label=<Get is called.<br/>
<FONT face="courier new">let blob = os.get(key);</FONT>>];

  LinkedPersistedInactive -> UnlinkedPersistedInactive
      [label=<The object store row is deleted.<br/>
<FONT face="courier new">os.delete(key);</FONT>>];
      
      
  LinkedPersistedActive -> UnlinkedPersistedActive
      [label=<The object store row is deleted.<br/>
<FONT face="courier new">os.delete(key);</FONT>>];
      
  LinkedPersistedActive -> LinkedPersistedInactive
      [label=<Blob from Get is dropped.<br/>
<FONT face="Courier New">blob = null;</FONT>>];
      
  UnlinkedPersistedActive -> UnlinkedPersistedInactive
      [label=<Blob from Get is dropped.<br/>
<FONT face="Courier New">blob = null;</FONT>>];
      
  UnlinkedPersistedInactive -> Deleted [label=" Recovery journal cleanup."];
}