This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 860" role="img" aria-labelledby="title desc">
|
||||
<title id="title">Поздний ответ не меняет новое поле</title>
|
||||
<desc id="desc">Временная диаграмма проверки логина: пользователь сначала вводит ivan и запускает медленный запрос с requestId 1, затем ivanka с requestId 2. Быстрый новый ответ применён, поздний старый ответ отклонён как устаревший.</desc>
|
||||
<defs>
|
||||
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0" stop-color="#162332"/>
|
||||
<stop offset="1" stop-color="#1d4658"/>
|
||||
</linearGradient>
|
||||
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto">
|
||||
<path d="M0 0L10 5L0 10z" fill="#98e0e8"/>
|
||||
</marker>
|
||||
<marker id="danger" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto">
|
||||
<path d="M0 0L10 5L0 10z" fill="#ff9d8d"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="720" height="860" rx="34" fill="url(#bg)"/>
|
||||
<text x="54" y="66" fill="#ffffff" font-family="Arial, sans-serif" font-size="30" font-weight="700">Два ответа, одно актуальное поле</text>
|
||||
<text x="54" y="100" fill="#c6dce9" font-family="Arial, sans-serif" font-size="18">Нельзя доверять времени ответа: сравниваем requestId.</text>
|
||||
|
||||
<g font-family="Arial, sans-serif">
|
||||
<text x="70" y="156" fill="#b9d5e4" font-size="18" font-weight="700">Пользователь</text>
|
||||
<text x="294" y="156" fill="#b9d5e4" font-size="18" font-weight="700">Форма</text>
|
||||
<text x="520" y="156" fill="#b9d5e4" font-size="18" font-weight="700">Проверка API</text>
|
||||
<path d="M150 174H650" stroke="#7ba2b6" stroke-width="2" stroke-dasharray="8 8"/>
|
||||
<path d="M150 174V746" stroke="#7ba2b6" stroke-width="2" stroke-dasharray="8 8"/>
|
||||
<path d="M370 174V746" stroke="#7ba2b6" stroke-width="2" stroke-dasharray="8 8"/>
|
||||
<path d="M604 174V746" stroke="#7ba2b6" stroke-width="2" stroke-dasharray="8 8"/>
|
||||
|
||||
<text x="68" y="230" fill="#ffffff" font-size="20">1. Ввод: ivan</text>
|
||||
<path d="M178 238H348" stroke="#98e0e8" stroke-width="6" marker-end="url(#arrow)"/>
|
||||
<rect x="238" y="258" width="236" height="74" rx="16" fill="#d9f5f4"/>
|
||||
<text x="260" y="289" fill="#15545a" font-size="18" font-weight="700">requestId = 1</text>
|
||||
<text x="260" y="314" fill="#2e7478" font-size="16">checking: ivan</text>
|
||||
<path d="M382 296H582" stroke="#98e0e8" stroke-width="6" marker-end="url(#arrow)"/>
|
||||
<text x="430" y="282" fill="#c6dce9" font-size="15">медленный ответ</text>
|
||||
|
||||
<text x="58" y="394" fill="#ffffff" font-size="20">2. Ввод: ivanka</text>
|
||||
<path d="M188 402H348" stroke="#98e0e8" stroke-width="6" marker-end="url(#arrow)"/>
|
||||
<rect x="238" y="422" width="236" height="74" rx="16" fill="#d9f5f4"/>
|
||||
<text x="260" y="453" fill="#15545a" font-size="18" font-weight="700">requestId = 2</text>
|
||||
<text x="260" y="478" fill="#2e7478" font-size="16">checking: ivanka</text>
|
||||
<path d="M382 460H582" stroke="#98e0e8" stroke-width="6" marker-end="url(#arrow)"/>
|
||||
<text x="432" y="446" fill="#c6dce9" font-size="15">быстрый ответ</text>
|
||||
|
||||
<path d="M594 506H394" stroke="#89e5b1" stroke-width="7" marker-end="url(#arrow)"/>
|
||||
<rect x="212" y="530" width="260" height="78" rx="16" fill="#d4f4df"/>
|
||||
<text x="236" y="562" fill="#15553a" font-size="19" font-weight="700">apply: requestId 2</text>
|
||||
<text x="236" y="588" fill="#2e7750" font-size="16">ivanka · valid · error пуст</text>
|
||||
<text x="482" y="540" fill="#9ee6b9" font-size="16">available</text>
|
||||
|
||||
<path d="M594 646H394" stroke="#ff9d8d" stroke-width="7" marker-end="url(#danger)"/>
|
||||
<path d="M358 620L426 688" stroke="#ff9d8d" stroke-width="8" stroke-linecap="round"/>
|
||||
<path d="M426 620L358 688" stroke="#ff9d8d" stroke-width="8" stroke-linecap="round"/>
|
||||
<text x="482" y="634" fill="#ffc2b8" font-size="16">occupied, но поздно</text>
|
||||
<rect x="212" y="704" width="316" height="72" rx="16" fill="#563543" stroke="#ff9d8d" stroke-width="2"/>
|
||||
<text x="236" y="735" fill="#ffd8d0" font-size="19" font-weight="700">ignore: stale-response</text>
|
||||
<text x="236" y="760" fill="#ffc2b8" font-size="16">1 !== current requestId 2</text>
|
||||
</g>
|
||||
<rect x="54" y="804" width="612" height="34" rx="17" fill="#235e6c"/>
|
||||
<text x="94" y="827" fill="#e7fbff" font-family="Arial, sans-serif" font-size="16" font-weight="700">Новый input очищает старую ошибку раньше следующего render.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
Reference in New Issue
Block a user