NGO-DB/ndb-core

View on GitHub
doc/images/new-session-flows/initial__sync_failed.svg

Summary

Maintainability
Test Coverage
<svg id="mermaid-1564681344022" width="100%" xmlns="http://www.w3.org/2000/svg" height="100%" style="max-width:1250px;" viewBox="-50 -10 1250 885"><style>#mermaid-1564681344022 .label{font-family:trebuchet ms,verdana,arial;color:#333}#mermaid-1564681344022 .node circle,#mermaid-1564681344022 .node ellipse,#mermaid-1564681344022 .node polygon,#mermaid-1564681344022 .node rect{fill:#ececff;stroke:#9370db;stroke-width:1px}#mermaid-1564681344022 .node.clickable{cursor:pointer}#mermaid-1564681344022 .arrowheadPath{fill:#333}#mermaid-1564681344022 .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-1564681344022 .edgeLabel{background-color:#e8e8e8}#mermaid-1564681344022 .cluster rect{fill:#ffffde!important;stroke:#aa3!important;stroke-width:1px!important}#mermaid-1564681344022 .cluster text{fill:#333}#mermaid-1564681344022 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:trebuchet ms,verdana,arial;font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-1564681344022 .actor{stroke:#ccf;fill:#ececff}#mermaid-1564681344022 text.actor{fill:#000;stroke:none}#mermaid-1564681344022 .actor-line{stroke:grey}#mermaid-1564681344022 .messageLine0{marker-end:"url(#arrowhead)"}#mermaid-1564681344022 .messageLine0,#mermaid-1564681344022 .messageLine1{stroke-width:1.5;stroke-dasharray:"2 2";stroke:#333}#mermaid-1564681344022 #arrowhead{fill:#333}#mermaid-1564681344022 #crosshead path{fill:#333!important;stroke:#333!important}#mermaid-1564681344022 .messageText{fill:#333;stroke:none}#mermaid-1564681344022 .labelBox{stroke:#ccf;fill:#ececff}#mermaid-1564681344022 .labelText,#mermaid-1564681344022 .loopText{fill:#000;stroke:none}#mermaid-1564681344022 .loopLine{stroke-width:2;stroke-dasharray:"2 2";marker-end:"url(#arrowhead)";stroke:#ccf}#mermaid-1564681344022 .note{stroke:#aa3;fill:#fff5ad}#mermaid-1564681344022 .noteText{fill:#000;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:14px}#mermaid-1564681344022 .section{stroke:none;opacity:.2}#mermaid-1564681344022 .section0{fill:rgba(102,102,255,.49)}#mermaid-1564681344022 .section2{fill:#fff400}#mermaid-1564681344022 .section1,#mermaid-1564681344022 .section3{fill:#fff;opacity:.2}#mermaid-1564681344022 .sectionTitle0,#mermaid-1564681344022 .sectionTitle1,#mermaid-1564681344022 .sectionTitle2,#mermaid-1564681344022 .sectionTitle3{fill:#333}#mermaid-1564681344022 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px}#mermaid-1564681344022 .grid .tick{stroke:#d3d3d3;opacity:.3;shape-rendering:crispEdges}#mermaid-1564681344022 .grid path{stroke-width:0}#mermaid-1564681344022 .today{fill:none;stroke:red;stroke-width:2px}#mermaid-1564681344022 .task{stroke-width:2}#mermaid-1564681344022 .taskText{text-anchor:middle;font-size:11px}#mermaid-1564681344022 .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px}#mermaid-1564681344022 .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-1564681344022 .taskText0,#mermaid-1564681344022 .taskText1,#mermaid-1564681344022 .taskText2,#mermaid-1564681344022 .taskText3{fill:#fff}#mermaid-1564681344022 .task0,#mermaid-1564681344022 .task1,#mermaid-1564681344022 .task2,#mermaid-1564681344022 .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-1564681344022 .taskTextOutside0,#mermaid-1564681344022 .taskTextOutside1,#mermaid-1564681344022 .taskTextOutside2,#mermaid-1564681344022 .taskTextOutside3{fill:#000}#mermaid-1564681344022 .active0,#mermaid-1564681344022 .active1,#mermaid-1564681344022 .active2,#mermaid-1564681344022 .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-1564681344022 .activeText0,#mermaid-1564681344022 .activeText1,#mermaid-1564681344022 .activeText2,#mermaid-1564681344022 .activeText3{fill:#000!important}#mermaid-1564681344022 .done0,#mermaid-1564681344022 .done1,#mermaid-1564681344022 .done2,#mermaid-1564681344022 .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-1564681344022 .doneText0,#mermaid-1564681344022 .doneText1,#mermaid-1564681344022 .doneText2,#mermaid-1564681344022 .doneText3{fill:#000!important}#mermaid-1564681344022 .crit0,#mermaid-1564681344022 .crit1,#mermaid-1564681344022 .crit2,#mermaid-1564681344022 .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-1564681344022 .activeCrit0,#mermaid-1564681344022 .activeCrit1,#mermaid-1564681344022 .activeCrit2,#mermaid-1564681344022 .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-1564681344022 .doneCrit0,#mermaid-1564681344022 .doneCrit1,#mermaid-1564681344022 .doneCrit2,#mermaid-1564681344022 .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-1564681344022 .activeCritText0,#mermaid-1564681344022 .activeCritText1,#mermaid-1564681344022 .activeCritText2,#mermaid-1564681344022 .activeCritText3,#mermaid-1564681344022 .doneCritText0,#mermaid-1564681344022 .doneCritText1,#mermaid-1564681344022 .doneCritText2,#mermaid-1564681344022 .doneCritText3{fill:#000!important}#mermaid-1564681344022 .titleText{text-anchor:middle;font-size:18px;fill:#000}#mermaid-1564681344022 g.classGroup text{fill:#9370db;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:10px}#mermaid-1564681344022 g.classGroup rect{fill:#ececff;stroke:#9370db}#mermaid-1564681344022 g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-1564681344022 .classLabel .box{stroke:none;stroke-width:0;fill:#ececff;opacity:.5}#mermaid-1564681344022 .classLabel .label{fill:#9370db;font-size:10px}#mermaid-1564681344022 .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-1564681344022 #compositionEnd,#mermaid-1564681344022 #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1564681344022 #aggregationEnd,#mermaid-1564681344022 #aggregationStart{fill:#ececff;stroke:#9370db;stroke-width:1}#mermaid-1564681344022 #dependencyEnd,#mermaid-1564681344022 #dependencyStart,#mermaid-1564681344022 #extensionEnd,#mermaid-1564681344022 #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1564681344022 .branch-label,#mermaid-1564681344022 .commit-id,#mermaid-1564681344022 .commit-msg{fill:#d3d3d3;color:#d3d3d3}</style><style>#mermaid-1564681344022 {
    color: rgb(0, 0, 0);
    font: normal normal 400 normal 16px / normal "Times New Roman";
  }</style><g></g><g><line id="actor0" x1="75" y1="5" x2="75" y2="874" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="0" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="75" dy="0">User</tspan></text></g><g><line id="actor1" x1="275" y1="5" x2="275" y2="874" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="200" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="275" dy="0">SyncedSession</tspan></text></g><g><line id="actor2" x1="475" y1="5" x2="475" y2="874" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="400" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="475" dy="0">LocalSession</tspan></text></g><g><line id="actor3" x1="675" y1="5" x2="675" y2="874" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="600" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="675" dy="0">Local PouchDB</tspan></text></g><g><line id="actor4" x1="875" y1="5" x2="875" y2="874" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="800" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="875" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="875" dy="0">RemoteSession</tspan></text></g><g><line id="actor5" x1="1075" y1="5" x2="1075" y2="874" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="1000" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1075" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="1075" dy="0">Remote PouchDB</tspan></text></g><defs><marker id="arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path d="M 0,0 V 4 L6,2 Z"></path></marker></defs><defs><marker id="crosshead" markerWidth="15" markerHeight="8" orient="auto" refX="16" refY="4"><path fill="black" stroke="#000000" stroke-width="1px" d="M 9,2 V 6 L16,4 Z" style="stroke-dasharray: 0, 0;"></path><path fill="none" stroke="#000000" stroke-width="1px" d="M 0,1 L 6,7 M 6,1 L 0,7" style="stroke-dasharray: 0, 0;"></path></marker></defs><g><rect x="70" y="67" fill="#f4f4f4" stroke="#666" width="10" height="722" rx="0" ry="0"></rect></g><g><text x="177.5" y="93" class="messageText" style="text-anchor: middle;">login</text><line x1="80" y1="100" x2="275" y2="100" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><rect x="270" y="102" fill="#f4f4f4" stroke="#666" width="10" height="687" rx="0" ry="0"></rect></g><g><text x="377.5" y="128" class="messageText" style="text-anchor: middle;">login</text><line x1="280" y1="135" x2="475" y2="135" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><rect x="470" y="137" fill="#f4f4f4" stroke="#666" width="10" height="617" rx="0" ry="0"></rect></g><g><text x="577.5" y="163" class="messageText" style="text-anchor: middle;">login</text><line x1="280" y1="170" x2="875" y2="170" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><rect x="870" y="172" fill="#f4f4f4" stroke="#666" width="10" height="214" rx="0" ry="0"></rect></g><g><text x="480" y="198" class="messageText" style="text-anchor: middle;">waitForFirstSync</text><path d="M 480,205 C 540,195 540,235 480,225" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><rect x="475" y="237" fill="#f4f4f4" stroke="#666" width="10" height="436" rx="0" ry="0"></rect></g><g><text x="977.5" y="263" class="messageText" style="text-anchor: middle;">login</text><line x1="880" y1="270" x2="1075" y2="270" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><rect x="1070" y="272" fill="#f4f4f4" stroke="#666" width="10" height="33" rx="0" ry="0"></rect></g><g><text x="975" y="298" class="messageText" style="text-anchor: middle;">connected</text><line x1="1070" y1="305" x2="880" y2="305" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></line></g><g><rect x="800" y="315" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="796" y="339" fill="black" class="noteText"><tspan x="816" fill="black">ConnectionState.CONNECTED</tspan></text></g><g><text x="575" y="379" class="messageText" style="text-anchor: middle;">ConnectionState.CONNECTED</text><line x1="870" y1="386" x2="280" y2="386" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></line></g><g><text x="280" y="414" class="messageText" style="text-anchor: middle;">sync</text><path d="M 280,421 C 340,411 340,451 280,441" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><rect x="275" y="453" fill="#f4f4f4" stroke="#666" width="10" height="109" rx="0" ry="0"></rect></g><g><rect x="400" y="461" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="485" fill="black" class="noteText"><tspan x="416" fill="black">SyncState.STARTED</tspan></text></g><g><text x="285" y="525" class="messageText" style="text-anchor: middle;">SyncState.FAILED</text><path d="M 285,532 C 345,522 345,562 285,552" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></path></g><g><rect x="400" y="572" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="596" fill="black" class="noteText"><tspan x="416" fill="black">SyncState.FAILED</tspan></text></g><g><text x="485" y="636" class="messageText" style="text-anchor: middle;">failure</text><path d="M 485,643 C 545,633 545,673 485,663" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><rect x="400" y="683" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="707" fill="black" class="noteText"><tspan x="416" fill="black">LoginState.loggedOff</tspan></text></g><g><text x="375" y="747" class="messageText" style="text-anchor: middle;">LoginState.loggedOff</text><line x1="470" y1="754" x2="280" y2="754" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></line></g><g><text x="175" y="782" class="messageText" style="text-anchor: middle;">LoginState.loggedOff</text><line x1="270" y1="789" x2="80" y2="789" class="messageLine1" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="stroke-dasharray: 3, 3; fill: none;"></line></g><g><rect x="0" y="809" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="841.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="75" dy="0">User</tspan></text></g><g><rect x="200" y="809" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="841.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="275" dy="0">SyncedSession</tspan></text></g><g><rect x="400" y="809" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="841.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="475" dy="0">LocalSession</tspan></text></g><g><rect x="600" y="809" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="841.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="675" dy="0">Local PouchDB</tspan></text></g><g><rect x="800" y="809" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="875" y="841.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="875" dy="0">RemoteSession</tspan></text></g><g><rect x="1000" y="809" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1075" y="841.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="1075" dy="0">Remote PouchDB</tspan></text></g></svg>