Skip to content

Commit 0aea3c2

Browse files
forge/AGENT.md: document the static-mirror request-storm trap
An app built for the origin's endpoints (aggregate route, notification socket) degrades on a plain static mirror into a fast per-item fetch storm (mostly 404). The real-time injection must also serve those reads from a client-side cache; plus two footguns — the injection runs after the app's init (reset any latched "endpoint absent" flag), and read the server log before chasing latency ghosts.
1 parent a8d9e55 commit 0aea3c2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

forge/AGENT.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ by subscribing to the same ephemeral channel (intercept the current-value fetch,
192192
re-render) — appended at deploy time by the subscriber's `postSync`, so the
193193
origin's own copy stays untouched.
194194

195+
**The mirror trap — an app built for the origin storms a static mirror.** If the
196+
app expects server endpoints the origin provides but a plain static mirror does
197+
not (an aggregate route, a notification socket), it will *degrade badly*: fall
198+
back to fetching every item individually on a fast poll, most of them 404 — a
199+
real request storm. The same injection that adds real-time must therefore also
200+
**serve those fetches from a client-side cache** (fetch the committed items once,
201+
answer subsequent reads from memory, patch the live one from the ephemeral
202+
channel). Two footguns: the injection is appended *after* the app's init, so
203+
reset any "endpoint absent" flag the app already latched; and **read the server
204+
log before theorizing** — a request storm is obvious in one `tail`, and a
205+
relay/latency rabbit-hole is not where the fix lives.
206+
195207
## Known walls / upstream
196208

197209
- **Core `--git` shadows plugin-owned git paths.** A server that also runs core

0 commit comments

Comments
 (0)