<mxfile host="app.diagrams.net" agent="architecture-deliverables" version="24.0.0">
  <diagram name="Message Send and Delivery Path" id="06-message-send-delivery">
    <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="1660" pageHeight="590" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="_st1" value="Compose" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontStyle=1;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="40" y="60" width="170" height="20" as="geometry" />
        </mxCell>
        <mxCell id="n.ratchet" value="&lt;b&gt;Double Ratchet&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;One key per message&lt;/font&gt;" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontColor=#3a2b44;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="40" y="170" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.sdev" value="&lt;b&gt;Sender Device&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Assigns client_msg_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="40" y="270" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="_st2" value="Ingress" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontStyle=1;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="320" y="60" width="170" height="20" as="geometry" />
        </mxCell>
        <mxCell id="n.gwin" value="&lt;b&gt;Connection Gateway&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Authenticated socket&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="320" y="150" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="n.idem" value="&lt;b&gt;Duplicate?&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;client_msg_id seen&lt;/font&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;size=0.12;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontColor=#4a3c00;fontSize=12;fontFamily=Segoe UI;verticalAlign=middle;align=center;" vertex="1" parent="1">
          <mxGeometry x="320" y="270" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="_st3" value="Accept &amp; order" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontStyle=1;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="600" y="60" width="170" height="20" as="geometry" />
        </mxCell>
        <mxCell id="n.chat" value="&lt;b&gt;Chat Service&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Server id + timestamp&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="600" y="170" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.mstore" value="&lt;b&gt;Message Store&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Ciphertext, TTL 30 d&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="600" y="270" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="_st4" value="Fan out" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontStyle=1;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="890" y="60" width="170" height="20" as="geometry" />
        </mxCell>
        <mxCell id="n.resolve" value="&lt;b&gt;Recipient Resolver&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Account to device list&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="890" y="90" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="n.fanout" value="&lt;b&gt;Fanout Workers&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Sharded by device&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="890" y="210" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="n.inbox" value="&lt;b&gt;Per-device Inbox&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Durable queue&lt;/font&gt;" style="shape=process;size=0.08;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="890" y="330" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="_st5" value="Deliver" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontStyle=1;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="1170" y="60" width="170" height="20" as="geometry" />
        </mxCell>
        <mxCell id="n.online" value="&lt;b&gt;Online Path&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Push down open socket&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="1170" y="170" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="n.offline" value="&lt;b&gt;Offline Path&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Silent APNs / FCM wake&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="1170" y="270" width="170" height="70" as="geometry" />
        </mxCell>
        <mxCell id="_st6" value="Confirm" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=10;fontStyle=1;fontColor=#8a97a5;fontFamily=Segoe UI;" vertex="1" parent="1">
          <mxGeometry x="1450" y="60" width="170" height="20" as="geometry" />
        </mxCell>
        <mxCell id="n.rdev" value="&lt;b&gt;Recipient Device&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Decrypt, store, ack&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="1450" y="150" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="n.rcpt" value="&lt;b&gt;Receipt Service&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:10px;color:#5b6b7d&quot;&gt;Delivered, read, played&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="1450" y="270" width="170" height="90" as="geometry" />
        </mxCell>
        <mxCell id="_spine7" value="" style="html=1;endArrow=block;endFill=1;strokeColor=#b8c4d0;strokeWidth=2;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="220" y="250" as="sourcePoint" />
            <mxPoint x="310" y="250" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_spine8" value="" style="html=1;endArrow=block;endFill=1;strokeColor=#b8c4d0;strokeWidth=2;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="500" y="250" as="sourcePoint" />
            <mxPoint x="590" y="250" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_spine9" value="" style="html=1;endArrow=block;endFill=1;strokeColor=#b8c4d0;strokeWidth=2;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="780" y="250" as="sourcePoint" />
            <mxPoint x="880" y="250" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_spine10" value="" style="html=1;endArrow=block;endFill=1;strokeColor=#b8c4d0;strokeWidth=2;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="1070" y="250" as="sourcePoint" />
            <mxPoint x="1160" y="250" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_spine11" value="" style="html=1;endArrow=block;endFill=1;strokeColor=#b8c4d0;strokeWidth=2;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="1350" y="250" as="sourcePoint" />
            <mxPoint x="1440" y="250" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_e12" value="no, accept" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;jettySize=auto;orthogonalLoop=1;endArrow=block;endFill=1;strokeColor=#5a6570;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;verticalAlign=bottom;fontFamily=Segoe UI;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="n.idem" target="n.chat">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="550" y="320" />
              <mxPoint x="550" y="210" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_e13" value="yes, replay server id" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;jettySize=auto;orthogonalLoop=1;dashed=1;endArrow=block;endFill=1;strokeColor=#b85450;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;verticalAlign=bottom;fontFamily=Segoe UI;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="n.idem" target="n.sdev">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="410" y="450" />
              <mxPoint x="130" y="450" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="_e14" value="receipt fanout to sender devices" style="edgeStyle=orthogonalEdgeStyle;rounded=1;html=1;jettySize=auto;orthogonalLoop=1;dashed=1;endArrow=open;endFill=0;strokeColor=#d79b00;strokeWidth=1.4;fontSize=10;fontColor=#42536a;labelBackgroundColor=#ffffff;verticalAlign=bottom;fontFamily=Segoe UI;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="n.rcpt" target="n.sdev">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1540" y="470" />
              <mxPoint x="130" y="470" />
            </Array>
          </mxGeometry>
        </mxCell>
        <mxCell id="title" value="Message Send and Delivery Path" 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="1570" 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="1570" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg15" value="" style="rounded=1;arcSize=30;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
          <mxGeometry x="40" y="490" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg16" value="Security / platform" 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="490" width="110" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg17" value="" style="rounded=1;arcSize=30;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="210" y="490" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg18" 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="240" y="490" width="110" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg19" value="" style="rounded=1;arcSize=30;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="370" y="490" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg20" value="Decision point" 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="400" y="490" width="90" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg21" value="" style="rounded=1;arcSize=30;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="500" y="490" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg22" 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="530" y="490" width="70" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg23" value="" style="rounded=1;arcSize=30;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
          <mxGeometry x="620" y="490" width="20" height="10" as="geometry" />
        </mxCell>
        <mxCell id="_lg24" value="Queue / topic" 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="650" y="490" width="80" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg25" value="" style="html=1;endArrow=none;strokeColor=#5a6570;strokeWidth=1.4;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="750" y="500" as="sourcePoint" />
            <mxPoint x="780" y="500" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_lg26" value="synchronous" 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="780" y="490" width="70" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg27" value="" style="html=1;endArrow=none;dashed=1;strokeColor=#b85450;strokeWidth=1.4;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="870" y="500" as="sourcePoint" />
            <mxPoint x="900" y="500" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_lg28" value="failure / alternate" 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="900" y="490" width="110" height="20" as="geometry" />
        </mxCell>
        <mxCell id="_lg29" value="" style="html=1;endArrow=none;dashed=1;strokeColor=#d79b00;strokeWidth=1.4;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="1040" y="500" as="sourcePoint" />
            <mxPoint x="1060" y="500" as="targetPoint" />
          </mxGeometry>
        </mxCell>
        <mxCell id="_lg30" value="event / async" 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="1060" y="490" width="80" height="20" as="geometry" />
        </mxCell>
        <mxCell id="note" value="Server ack sets the single tick; the recipient device sets every state after it." 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="520" width="1570" 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="540" width="1570" 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="550" width="1570" height="10" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
