Human-readable plural noun used in the error message
("account statuses", "media buy states"). Intended to be a
caller-controlled string literal; defensively truncated to 64 chars and
stripped of non-printable characters before interpolation so user-controlled
input can't spam logs.
async forceAccountStatus(accountId, status) {
enforceMapCap(session.accountStatuses, accountId, 'account statuses');
const prev = session.accountStatuses.get(accountId) ?? 'active';
session.accountStatuses.set(accountId, status);
return { success: true, previous_state: prev, current_state: status };
}
Reject new entries when
maphas reachedcap. Use inside TestControllerStore methods before.set()on any Map that accumulates per-session state (account statuses, media-buy states, simulated deliveries). Existing keys are allowed to overwrite — only net-new keys are rejected at the cap.Rejects via TestControllerError with code
INVALID_STATE, which the dispatcher converts to a typedControllerErrorresponse. The caller gets a clear "clear the session or reuse an existing id" error rather than silent LRU eviction that would make compliance tests nondeterministic.