NGO-DB/ndb-core

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

Summary

Maintainability
Test Coverage
<svg id="mermaid-1564681292508" width="100%" xmlns="http://www.w3.org/2000/svg" height="100%" style="max-width:1250px;" viewBox="-50 -10 1250 744"><style>#mermaid-1564681292508 .label{font-family:trebuchet ms,verdana,arial;color:#333}#mermaid-1564681292508 .node circle,#mermaid-1564681292508 .node ellipse,#mermaid-1564681292508 .node polygon,#mermaid-1564681292508 .node rect{fill:#ececff;stroke:#9370db;stroke-width:1px}#mermaid-1564681292508 .node.clickable{cursor:pointer}#mermaid-1564681292508 .arrowheadPath{fill:#333}#mermaid-1564681292508 .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-1564681292508 .edgeLabel{background-color:#e8e8e8}#mermaid-1564681292508 .cluster rect{fill:#ffffde!important;stroke:#aa3!important;stroke-width:1px!important}#mermaid-1564681292508 .cluster text{fill:#333}#mermaid-1564681292508 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-1564681292508 .actor{stroke:#ccf;fill:#ececff}#mermaid-1564681292508 text.actor{fill:#000;stroke:none}#mermaid-1564681292508 .actor-line{stroke:grey}#mermaid-1564681292508 .messageLine0{marker-end:"url(#arrowhead)"}#mermaid-1564681292508 .messageLine0,#mermaid-1564681292508 .messageLine1{stroke-width:1.5;stroke-dasharray:"2 2";stroke:#333}#mermaid-1564681292508 #arrowhead{fill:#333}#mermaid-1564681292508 #crosshead path{fill:#333!important;stroke:#333!important}#mermaid-1564681292508 .messageText{fill:#333;stroke:none}#mermaid-1564681292508 .labelBox{stroke:#ccf;fill:#ececff}#mermaid-1564681292508 .labelText,#mermaid-1564681292508 .loopText{fill:#000;stroke:none}#mermaid-1564681292508 .loopLine{stroke-width:2;stroke-dasharray:"2 2";marker-end:"url(#arrowhead)";stroke:#ccf}#mermaid-1564681292508 .note{stroke:#aa3;fill:#fff5ad}#mermaid-1564681292508 .noteText{fill:#000;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:14px}#mermaid-1564681292508 .section{stroke:none;opacity:.2}#mermaid-1564681292508 .section0{fill:rgba(102,102,255,.49)}#mermaid-1564681292508 .section2{fill:#fff400}#mermaid-1564681292508 .section1,#mermaid-1564681292508 .section3{fill:#fff;opacity:.2}#mermaid-1564681292508 .sectionTitle0,#mermaid-1564681292508 .sectionTitle1,#mermaid-1564681292508 .sectionTitle2,#mermaid-1564681292508 .sectionTitle3{fill:#333}#mermaid-1564681292508 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px}#mermaid-1564681292508 .grid .tick{stroke:#d3d3d3;opacity:.3;shape-rendering:crispEdges}#mermaid-1564681292508 .grid path{stroke-width:0}#mermaid-1564681292508 .today{fill:none;stroke:red;stroke-width:2px}#mermaid-1564681292508 .task{stroke-width:2}#mermaid-1564681292508 .taskText{text-anchor:middle;font-size:11px}#mermaid-1564681292508 .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px}#mermaid-1564681292508 .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-1564681292508 .taskText0,#mermaid-1564681292508 .taskText1,#mermaid-1564681292508 .taskText2,#mermaid-1564681292508 .taskText3{fill:#fff}#mermaid-1564681292508 .task0,#mermaid-1564681292508 .task1,#mermaid-1564681292508 .task2,#mermaid-1564681292508 .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-1564681292508 .taskTextOutside0,#mermaid-1564681292508 .taskTextOutside1,#mermaid-1564681292508 .taskTextOutside2,#mermaid-1564681292508 .taskTextOutside3{fill:#000}#mermaid-1564681292508 .active0,#mermaid-1564681292508 .active1,#mermaid-1564681292508 .active2,#mermaid-1564681292508 .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-1564681292508 .activeText0,#mermaid-1564681292508 .activeText1,#mermaid-1564681292508 .activeText2,#mermaid-1564681292508 .activeText3{fill:#000!important}#mermaid-1564681292508 .done0,#mermaid-1564681292508 .done1,#mermaid-1564681292508 .done2,#mermaid-1564681292508 .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-1564681292508 .doneText0,#mermaid-1564681292508 .doneText1,#mermaid-1564681292508 .doneText2,#mermaid-1564681292508 .doneText3{fill:#000!important}#mermaid-1564681292508 .crit0,#mermaid-1564681292508 .crit1,#mermaid-1564681292508 .crit2,#mermaid-1564681292508 .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-1564681292508 .activeCrit0,#mermaid-1564681292508 .activeCrit1,#mermaid-1564681292508 .activeCrit2,#mermaid-1564681292508 .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-1564681292508 .doneCrit0,#mermaid-1564681292508 .doneCrit1,#mermaid-1564681292508 .doneCrit2,#mermaid-1564681292508 .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-1564681292508 .activeCritText0,#mermaid-1564681292508 .activeCritText1,#mermaid-1564681292508 .activeCritText2,#mermaid-1564681292508 .activeCritText3,#mermaid-1564681292508 .doneCritText0,#mermaid-1564681292508 .doneCritText1,#mermaid-1564681292508 .doneCritText2,#mermaid-1564681292508 .doneCritText3{fill:#000!important}#mermaid-1564681292508 .titleText{text-anchor:middle;font-size:18px;fill:#000}#mermaid-1564681292508 g.classGroup text{fill:#9370db;stroke:none;font-family:trebuchet ms,verdana,arial;font-size:10px}#mermaid-1564681292508 g.classGroup rect{fill:#ececff;stroke:#9370db}#mermaid-1564681292508 g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-1564681292508 .classLabel .box{stroke:none;stroke-width:0;fill:#ececff;opacity:.5}#mermaid-1564681292508 .classLabel .label{fill:#9370db;font-size:10px}#mermaid-1564681292508 .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-1564681292508 #compositionEnd,#mermaid-1564681292508 #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1564681292508 #aggregationEnd,#mermaid-1564681292508 #aggregationStart{fill:#ececff;stroke:#9370db;stroke-width:1}#mermaid-1564681292508 #dependencyEnd,#mermaid-1564681292508 #dependencyStart,#mermaid-1564681292508 #extensionEnd,#mermaid-1564681292508 #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1564681292508 .branch-label,#mermaid-1564681292508 .commit-id,#mermaid-1564681292508 .commit-msg{fill:#d3d3d3;color:#d3d3d3}</style><style>#mermaid-1564681292508 {
    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="733" 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="733" 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="733" 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="733" 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="733" 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="733" 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="581" 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="546" 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="476" 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="341" 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;">rejected</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.REJECTED</tspan></text></g><g><text x="575" y="379" class="messageText" style="text-anchor: middle;">ConnectionState.REJECTED</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="375" y="414" class="messageText" style="text-anchor: middle;">set login and sync failed</text><line x1="280" y1="421" x2="470" y2="421" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><rect x="400" y="431" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="455" fill="black" class="noteText"><tspan x="416" fill="black">LoginState.LOGIN_FAILED</tspan></text></g><g><rect x="400" y="477" fill="#EDF2AE" stroke="#666" width="150" height="36" rx="0" ry="0" class="note"></rect><text x="396" y="501" fill="black" class="noteText"><tspan x="416" fill="black">SyncState.FAILED</tspan></text></g><g><text x="485" y="541" class="messageText" style="text-anchor: middle;">failure</text><path d="M 485,548 C 545,538 545,578 485,568" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><text x="375" y="606" class="messageText" style="text-anchor: middle;">LoginState.LOGIN_FAILED</text><line x1="470" y1="613" x2="280" y2="613" 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="641" class="messageText" style="text-anchor: middle;">LoginState.LOGIN_FAILED</text><line x1="270" y1="648" x2="80" y2="648" 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="668" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="700.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="668" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="700.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="668" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="700.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="668" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="700.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="668" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="875" y="700.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="668" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="1075" y="700.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;"><tspan x="1075" dy="0">Remote PouchDB</tspan></text></g></svg>