revise July 2022 poor network articles
Build and deploy / deploy (push) Successful in 13s

This commit is contained in:
2026-07-31 13:51:28 +03:00
parent 2bfc9d929f
commit ec1fa93fd2
7 changed files with 673 additions and 1 deletions
@@ -0,0 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="540" viewBox="0 0 900 540" role="img" aria-labelledby="title desc">
<title id="title">Диагностика unknown outcome и безопасное восстановление черновика</title>
<desc id="desc">Дерево решений показывает, как от отсутствия acknowledgement перейти к проверке ключей, игнорированию старого ответа, сохранению нового черновика или ручному восстановлению без ложного отката.</desc>
<defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto"><path d="M0 0L10 5L0 10z" fill="#475569"/></marker><style>.box{stroke:#475569;stroke-width:3;rx:14}.h{font:700 22px Arial,sans-serif;fill:#0f172a}.t{font:17px Arial,sans-serif;fill:#334155}.s{font:15px Arial,sans-serif;fill:#64748b}.line{stroke:#475569;stroke-width:4;fill:none;marker-end:url(#arrow)}.q{font:700 16px Arial,sans-serif;fill:#7c3aed}</style></defs>
<rect width="900" height="540" fill="#fbfdff"/>
<text x="42" y="46" class="h">Диагностика: не угадывать результат, сохранить контролируемые данные</text>
<rect x="324" y="84" width="252" height="90" class="box" fill="#fee2e2"/><text x="352" y="121" class="h">Нет acknowledgement</text><text x="352" y="151" class="t">visible: result unknown</text>
<rect x="72" y="257" width="215" height="112" class="box" fill="#fef3c7"/><text x="94" y="296" class="h">Offline label?</text><text x="94" y="326" class="t">retry blocked</text><text x="94" y="350" class="s">draft retained</text>
<rect x="343" y="257" width="215" height="112" class="box" fill="#dbeafe"/><text x="365" y="296" class="h">Reply пришёл?</text><text x="365" y="326" class="t">keys совпали?</text><text x="365" y="350" class="s">attempt + request + v</text>
<rect x="631" y="257" width="215" height="112" class="box" fill="#e9d5ff"/><text x="653" y="296" class="h">Нужна сверка</text><text x="653" y="326" class="t">recovery required</text><text x="653" y="350" class="s">не transport rollback</text>
<rect x="343" y="420" width="215" height="76" class="box" fill="#dcfce7"/><text x="365" y="452" class="h">Commit ack</text><text x="365" y="478" class="t">newer draft stays</text>
<path d="M450 174V244H180V248" class="line"/><text x="228" y="231" class="q">нет retry</text>
<path d="M450 174V248" class="line"/><text x="462" y="220" class="q">есть reply</text>
<path d="M450 174V244H737V248" class="line"/><text x="620" y="231" class="q">оставить draft</text>
<path d="M450 369V411" class="line"/><text x="464" y="397" class="q">current ack</text>
<text x="45" y="523" class="s">Вопросы относятся к state machine. Реальная сеть, серверная сверка и persistence требуют отдельного теста с условиями.</text>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="540" viewBox="0 0 900 540" role="img" aria-labelledby="title desc">
<title id="title">Контракт ключей повторной отправки</title>
<desc id="desc">Схема связывает версию черновика с request key, две попытки с разными attempt key и acknowledgement, которое проходит проверку всех полей. Старый ответ отмечен как stale.</desc>
<defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto"><path d="M0 0L10 5L0 10z" fill="#334155"/></marker><style>.box{stroke:#334155;stroke-width:3;rx:14}.h{font:700 23px Arial,sans-serif;fill:#0f172a}.t{font:18px Arial,sans-serif;fill:#334155}.s{font:15px Arial,sans-serif;fill:#64748b}.line{stroke:#334155;stroke-width:4;fill:none;marker-end:url(#arrow)}.ok{fill:#166534;font:700 17px Arial,sans-serif}.bad{fill:#b91c1c;font:700 17px Arial,sans-serif}</style></defs>
<rect width="900" height="540" fill="#f8fafc"/>
<text x="42" y="47" class="h">Контракт retry: один logical request, разные попытки</text>
<rect x="46" y="106" width="195" height="120" class="box" fill="#e0f2fe"/><text x="67" y="145" class="h">draft v1</text><text x="67" y="177" class="t">requestKey</text><text x="67" y="203" class="t">draft-v1</text>
<rect x="347" y="84" width="205" height="142" class="box" fill="#fef3c7"/><text x="368" y="123" class="h">attempt-01</text><text x="368" y="155" class="t">ожидает ack</text><text x="368" y="185" class="s">unknown outcome</text>
<rect x="347" y="316" width="205" height="142" class="box" fill="#dbeafe"/><text x="368" y="355" class="h">attempt-02</text><text x="368" y="387" class="t">тот же draft-v1</text><text x="368" y="417" class="s">один guard retry</text>
<rect x="658" y="84" width="196" height="142" class="box" fill="#fee2e2"/><text x="679" y="123" class="h">старый ack</text><text x="679" y="155" class="t">attempt-01</text><text x="679" y="188" class="bad">STALE: ignore</text>
<rect x="658" y="316" width="196" height="142" class="box" fill="#dcfce7"/><text x="679" y="355" class="h">accepted ack</text><text x="679" y="387" class="t">attempt-02 + v1</text><text x="679" y="420" class="ok">commit once</text>
<path d="M241 166H338" class="line"/><path d="M451 226V307" class="line"/><path d="M552 155H648" class="line"/><path d="M552 387H648" class="line"/>
<text x="50" y="497" class="s">Commit требует совпадения request key, current attempt key и accepted version. Это учебная схема, не ответ сервера.</text>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

@@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="540" viewBox="0 0 900 540" role="img" aria-labelledby="title desc">
<title id="title">Учебные состояния отправки черновика при плохой сети</title>
<desc id="desc">Диаграмма показывает черновик, блокировку offline, ожидание acknowledgement, неизвестный результат, повтор и подтверждение. Все состояния помечены как учебные.</desc>
<defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto"><path d="M0 0L10 5L0 10z" fill="#1d4ed8"/></marker><style>.box{stroke-width:3;rx:16}.h{font:700 25px Arial,sans-serif;fill:#102a43}.t{font:18px Arial,sans-serif;fill:#243b53}.s{font:15px Arial,sans-serif;fill:#52667a}.line{stroke:#1d4ed8;stroke-width:4;fill:none;marker-end:url(#arrow)}.label{font:700 16px Arial,sans-serif;fill:#1d4ed8}</style></defs>
<rect width="900" height="540" fill="#f7fbff"/>
<text x="42" y="48" class="h">Учебная модель: видимое состояние важнее догадки о сети</text>
<rect x="45" y="100" width="210" height="112" class="box" fill="#e0f2fe" stroke="#0284c7"/><text x="68" y="140" class="h">Черновик готов</text><text x="68" y="172" class="t">version + local copy</text><text x="68" y="196" class="s">не равно server save</text>
<rect x="45" y="330" width="210" height="112" class="box" fill="#fef3c7" stroke="#d97706"/><text x="68" y="370" class="h">Offline</text><text x="68" y="402" class="t">попытка не планируется</text><text x="68" y="426" class="s">черновик остаётся</text>
<rect x="345" y="100" width="210" height="112" class="box" fill="#dbeafe" stroke="#2563eb"/><text x="368" y="140" class="h">Ждём ack</text><text x="368" y="172" class="t">request + attempt key</text><text x="368" y="196" class="s">success ещё запрещён</text>
<rect x="345" y="330" width="210" height="112" class="box" fill="#fee2e2" stroke="#dc2626"/><text x="368" y="370" class="h">Unknown</text><text x="368" y="402" class="t">нет model acknowledgement</text><text x="368" y="426" class="s">не факт о сервере</text>
<rect x="645" y="100" width="210" height="112" class="box" fill="#dcfce7" stroke="#16a34a"/><text x="668" y="140" class="h">Подтверждено</text><text x="668" y="172" class="t">ack + accepted version</text><text x="668" y="196" class="s">новый draft отдельно</text>
<path d="M255 156H337" class="line"/><text x="273" y="140" class="label">submit</text>
<path d="M150 212V321" class="line"/><text x="170" y="274" class="label">declared offline</text>
<path d="M345 183C295 235 294 274 345 331" class="line"/><text x="240" y="260" class="label">нет ack</text>
<path d="M555 156H637" class="line"/><text x="576" y="140" class="label">ack</text>
<path d="M555 386C624 386 625 216 556 184" class="line"/><text x="578" y="310" class="label">retry: тот же request,</text><text x="612" y="332" class="label">новый attempt</text>
<text x="45" y="495" class="s">Граница: SVG описывает contract UI; здесь нет HTTP, Fetch, service worker, trace или измеренного network outcome.</text>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB