[fix](trx-frontend-http): stop the decode history replay giving up at 20s
Reloading a second time sometimes showed history the first load did not, and the safety valve is why: it called one function that both released the buffered live decodes and tore the history worker down, so any load where the replay had not finished inside twenty seconds — a large backlog, a cold cache, a slow link — dropped whatever had not arrived, without a word. A reload got another go at it, and the second one is faster because everything is cached by then. Those are two separate things now. At the timeout the live decodes are released so the panels are not held back, the replay carries on, and the progress says so. The fallback's error path retries once and then says "Decode history unavailable" rather than leaving the operator to guess whether there was anything to see. The progress is no longer a scrim. It was fixed to the whole viewport with a wash over the page — the waterfall, the decode panels, all of it — for the length of the replay, which is exactly when there is something worth watching. It is a corner card with a bar: indeterminate while the payload is on the wire, then filling as N of M messages replay. None of this was reachable from a test. /decode/history answers in CBOR and the worker reads the body as CBOR unconditionally, but the fixture served JSON, so every browser run had been exercising the client's retry path and never its history path. It encodes CBOR now, including the 64-bit form the millisecond timestamps need, and decode-flow serves 1200 records and holds the client to restoring all of them on the first load, showing progress while it does, and never covering the page with it. Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -2209,6 +2209,74 @@ small { color: var(--text-muted); }
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* Decode history loads in the corner, not over the page. It was a full-screen
|
||||
scrim: the operator could not read the waterfall, the decode panels or
|
||||
anything else while a large history replayed, and the replay is exactly when
|
||||
there is something to watch. */
|
||||
.history-progress {
|
||||
position: fixed;
|
||||
left: var(--space-4);
|
||||
bottom: var(--space-4);
|
||||
z-index: 120;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
width: min(20rem, calc(100vw - 2rem));
|
||||
padding: 0.6rem 0.75rem 0.7rem;
|
||||
border: 1px solid color-mix(in srgb, var(--border-light) 70%, transparent);
|
||||
border-radius: var(--radius-md);
|
||||
background: color-mix(in srgb, var(--card-bg) 94%, transparent);
|
||||
box-shadow: 0 10px 24px color-mix(in srgb, var(--bg) 35%, transparent);
|
||||
pointer-events: none;
|
||||
transition: opacity var(--dur-base) var(--ease-standard),
|
||||
visibility var(--dur-base) var(--ease-standard);
|
||||
}
|
||||
.history-progress.is-hidden {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.history-progress-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.1rem;
|
||||
min-width: 0;
|
||||
}
|
||||
.history-progress-title {
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 700;
|
||||
color: var(--text-heading);
|
||||
}
|
||||
.history-progress-sub {
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-muted);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.history-progress-track {
|
||||
height: 0.28rem;
|
||||
border-radius: var(--radius-pill);
|
||||
background: color-mix(in srgb, var(--border-light) 45%, transparent);
|
||||
overflow: hidden;
|
||||
}
|
||||
.history-progress-bar {
|
||||
display: block;
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
border-radius: inherit;
|
||||
background: var(--accent-green);
|
||||
transition: width var(--dur-base) var(--ease-out);
|
||||
}
|
||||
/* Indeterminate while the payload is still on the wire. */
|
||||
.history-progress[data-phase="fetching"] .history-progress-bar {
|
||||
width: 35%;
|
||||
animation: trx-history-sweep 1.1s var(--ease-standard) infinite;
|
||||
}
|
||||
@keyframes trx-history-sweep {
|
||||
0% { transform: translateX(-100%); }
|
||||
100% { transform: translateX(285%); }
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.history-progress { bottom: calc(5.9rem + env(safe-area-inset-bottom)); }
|
||||
}
|
||||
.decode-history-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
|
||||
Reference in New Issue
Block a user