fix(test-servers): describe and test after-first's resource-subscription counting

Copilot review on #2176. All three findings were the same gap seen from
three angles: `"after-first"` counts *resource-subscription* listens, not
listens, and both the README and the option's own doc comment said
"the first listen".

That distinction is load-bearing rather than incidental — the Inspector
opens a listen at connect time whenever a list-change opt-in is live
(#1920), so counting listens would spend the allowance there and refuse
the user's very first Subscribe, leaving the documented repro describing
a trace nobody sees. It is also what a reader of the option would
otherwise get wrong.

- README: say "the first listen that subscribes to a resource" in both
  places, and name the connect-time listen as the reason.
- `ServerConfig.modern.neverAcknowledgeSubscriptions`: document the
  list-change exemption and contrast it with `true`.
- Integration test for the mode itself, with every list-change opt-in on
  so the connect-time listen really is opened: it must be acknowledged
  without consuming the allowance, the first resource subscription
  acknowledged, the next refused with the stream left `active`.

Closes #2097

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-27 21:14:30 -04:00
commit 9136ab6268

View file

@ -707,10 +707,21 @@ export interface ServerConfig {
* same breath". Used by the `subscriptions-never-acknowledged-http`
* showcase; a conformant server never does this on an opening listen.
*
* `"after-first"` acknowledges the first listen and refuses every one after
* it — the *reconnect* shape, and the only way to reach the Inspector's
* `"after-first"` acknowledges the first listen that **subscribes to a
* resource** and refuses every resource-subscription listen after it — the
* *reconnect* shape, and the only way to reach the Inspector's
* never-acknowledged badge by hand (it is gated on a live subscription,
* which a server refusing from the outset never lets you hold).
*
* A listen carrying no `resourceSubscriptions` is always acknowledged under
* this mode and does not consume the allowance. That exemption is what makes
* the mode reproducible: the Inspector already opens a listen at connect
* time when a list-change opt-in is live (#1920), so counting listens rather
* than resource-subscription listens would spend the allowance before the
* user clicks anything, refusing the very first Subscribe.
*
* `true` refuses every listen unconditionally, list-change-only ones
* included — the literal shape in the report.
*/
neverAcknowledgeSubscriptions?: boolean | "after-first";
};