<mxfile host="app.diagrams.net" agent="architecture-deliverables" version="24.0.0">
  <diagram name="Offline Queuing and Retry Loop" id="09-offline-sync-retry">
    <mxGraphModel dx="1400" dy="900" background="#ffffff" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="770" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="n.undel" value="&lt;b&gt;Undelivered ciphertext&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Per-device inbox&lt;/font&gt;" style="shape=cylinder3;boundedLbl=1;backgroundOutline=1;size=11;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#1e3a1e;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="660" y="100" width="190" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.wake" value="&lt;b&gt;Push wake&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;APNs / FCM, no content&lt;/font&gt;" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;fontColor=#4a3200;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="1030" y="200" width="190" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.recon" value="&lt;b&gt;Client reconnects&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Noise session resume&lt;/font&gt;" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#1a2b45;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="1030" y="400" width="190" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.drain" value="&lt;b&gt;Inbox drain&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Ordered by server id&lt;/font&gt;" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#1a2b45;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="660" y="510" width="190" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.ack" value="&lt;b&gt;Per-message ack&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Deduplicated by id&lt;/font&gt;" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#1a2b45;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="280" y="400" width="190" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.purge" value="&lt;b&gt;Purge from server&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Or TTL at 30 days&lt;/font&gt;" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#1a2b45;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="280" y="200" width="190" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.centre" value="&lt;b&gt;At-least-once delivery&lt;/b&gt;" style="rounded=1;arcSize=6;whiteSpace=wrap;html=1;fillColor=#f7f9fb;strokeColor=#c9d3de;fontColor=#42536a;fontSize=13;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="640" y="300" width="230" height="70" as="geometry" />
        </mxCell>
        <mxCell id="_ring1" value="silent push" style="curved=1;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;fontFamily=Segoe UI;" edge="1" parent="1" source="n.undel" target="n.wake">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1010" y="120" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_ring2" value="socket opens" style="curved=1;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;fontFamily=Segoe UI;" edge="1" parent="1" source="n.wake" target="n.recon">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1270" y="340" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_ring3" value="batched pull" style="curved=1;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;fontFamily=Segoe UI;" edge="1" parent="1" source="n.recon" target="n.drain">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1010" y="550" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_ring4" value="ack each id" style="curved=1;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;fontFamily=Segoe UI;" edge="1" parent="1" source="n.drain" target="n.ack">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="490" y="550" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_ring5" value="delete ciphertext" style="curved=1;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;fontFamily=Segoe UI;" edge="1" parent="1" source="n.ack" target="n.purge">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="230" y="340" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_ring6" value="re-queue if no ack" style="curved=1;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;fontFamily=Segoe UI;" edge="1" parent="1" source="n.purge" target="n.undel">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="490" y="120" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="title" value="Offline Queuing and Retry Loop" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=20;fontStyle=1;fontColor=#16202c;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="40" y="20" width="1410" height="30" as="geometry" />
        </mxCell>
        <mxCell id="rule" value="" style="line;strokeWidth=1;html=1;strokeColor=#c9d3de;" vertex="1" parent="1">
          <mxGeometry x="40" y="50" width="1410" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg7" value="" style="rounded=1;arcSize=30;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="40" y="670" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg8" value="Data store" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontColor=#7b8794;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="70" y="670" width="70" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg9" value="" style="rounded=1;arcSize=30;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
          <mxGeometry x="160" y="670" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg10" value="Interface / broker" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontColor=#7b8794;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="190" y="670" width="110" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg11" value="" style="rounded=1;arcSize=30;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="320" y="670" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg12" value="Application we own" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontColor=#7b8794;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="350" y="670" width="110" height="20" as="geometry" />
        </mxCell>
        <mxCell id="note" value="Retry uses exponential backoff with jitter; the client discards duplicates by message id." style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="40" y="700" width="1410" height="20" as="geometry" />
        </mxCell>
        <mxCell id="foot-rule" value="" style="line;strokeWidth=1;html=1;strokeColor=#e3e9ef;" vertex="1" parent="1">
          <mxGeometry x="40" y="720" width="1410" height="10" as="geometry" />
        </mxCell>
        <mxCell id="foot" value="v 1.0   ·   owner Platform Architecture   ·   date 2026-08" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=9;fontColor=#9aa7b4;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="40" y="740" width="1410" height="10" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
