Skip to content

Commit 26e08e1

Browse files
committed
fix: restore revoke null-safety and refresh API snapshots
Restore the optional-chaining guard in revokeActiveConnectionsForToken: an earlier assertion cleanup dropped it, so a context without an rpc host threw "Cannot read properties of undefined (reading '_rpcGroup')" instead of returning early (surfaced by host-docks.test.ts). Update the tsnapi dts snapshots for devframe/internal and @devframes/json-render node so the diagnostic `fix` literal types match the reworded messages. Created with the help of an agent.
1 parent 1d93a3e commit 26e08e1

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎packages/devframe/src/node/auth/revoke.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export async function revokeActiveConnectionsForToken(
1414
context: DevframeNodeContext,
1515
token: string,
1616
): Promise<void> {
17-
const rpcHost = context.rpc as RpcFunctionsHostImpl
18-
if (!rpcHost._rpcGroup)
17+
const rpcHost = context.rpc as RpcFunctionsHostImpl | undefined
18+
if (!rpcHost?._rpcGroup)
1919
return
2020

2121
const affectedSessionIds = new Set<string>()

‎tests/__snapshots__/tsnapi/@devframes/json-render/node.snapshot.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export declare const jsonRenderDiagnostics: Diagnostics<{
4343
id: string;
4444
reason: string;
4545
}) => string;
46-
readonly fix: "Specs and state travel as strict JSON — remove functions, symbols, class instances, Map/Set, or circular references.";
46+
readonly fix: "Specs and state travel as strict JSON, so remove functions, symbols, class instances, Map/Set, or circular references.";
4747
};
4848
readonly DF0073: {
4949
readonly why: (p: {

‎tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
127127
channel: string;
128128
id: string;
129129
}) => string;
130-
readonly fix: "Track the producer lifecycle — guard writes with the `stream.signal.aborted` flag.";
130+
readonly fix: "Track the producer lifecycle by guarding writes with the `stream.signal.aborted` flag.";
131131
};
132132
readonly DF0032: {
133133
readonly why: (p: {
@@ -159,7 +159,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
159159
readonly why: (p: {
160160
name: string;
161161
}) => string;
162-
readonly fix: "Complete the auth handshake (or connect with a static/pre-shared token) before calling a trusted method. Untrusted callers may only call `anonymous:`-prefixed methods — see `isAnonymousRpcMethod`.";
162+
readonly fix: "Complete the auth handshake (or connect with a static/pre-shared token) before calling a trusted method. Untrusted callers may only call `anonymous:`-prefixed methods; see `isAnonymousRpcMethod`.";
163163
};
164164
readonly DF0037: {
165165
readonly why: (p: {
@@ -208,7 +208,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
208208
readonly why: (p: {
209209
port: number;
210210
}) => string;
211-
readonly fix: "Call devframe_connect_list-instances for the current instance list — the instance may have stopped or changed port.";
211+
readonly fix: "Call devframe_connect_list-instances for the current instance list; the instance may have stopped or changed port.";
212212
};
213213
readonly DF0051: {
214214
readonly why: (p: {
@@ -228,7 +228,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
228228
readonly why: (p: {
229229
id: string;
230230
}) => string;
231-
readonly fix: "Await `instance.ready` (or any request through `instance.handler`) before reading `connectionMeta()` — the WebSocket binding it describes is only known once initialization completes.";
231+
readonly fix: "Await `instance.ready` (or any request through `instance.handler`) before reading `connectionMeta()`; the WebSocket binding it describes is only known once initialization completes.";
232232
};
233233
readonly DF0055: {
234234
readonly why: (p: {
@@ -244,7 +244,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
244244
};
245245
readonly DF0057: {
246246
readonly why: () => string;
247-
readonly fix: "Clients connect over the SSE endpoint instead — no upgrade wiring is needed. Remove `ws: false` if the instance should serve a WebSocket after all.";
247+
readonly fix: "Clients connect over the SSE endpoint instead, so no upgrade wiring is needed. Remove `ws: false` if the instance should serve a WebSocket after all.";
248248
};
249249
readonly DF0058: {
250250
readonly why: (p: {
@@ -275,7 +275,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
275275
required: string;
276276
installed: string;
277277
}) => string;
278-
readonly fix: "Align the installed assets package with the version its node package declares — they are published in lockstep.";
278+
readonly fix: "Align the installed assets package with the version its node package declares; they are published in lockstep.";
279279
};
280280
readonly DF0062: {
281281
readonly why: (p: {
@@ -305,7 +305,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
305305
field: "package" | "version";
306306
value: string;
307307
}) => string;
308-
readonly fix: "A remote-assets `package` must be a valid npm package name and `version` an exact semver version (e.g. `1.2.3`) — they are interpolated into CDN URLs and the cache path.";
308+
readonly fix: "A remote-assets `package` must be a valid npm package name and `version` an exact semver version (e.g. `1.2.3`); they are interpolated into CDN URLs and the cache path.";
309309
};
310310
readonly DF0066: {
311311
readonly why: (p: {
@@ -341,7 +341,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
341341
package: string;
342342
reason: string;
343343
}) => string;
344-
readonly fix: "A service package's default export must be a factory returning a `DevframeServiceDefinition` — an object with `package`, `version`, `scope`, and a `setup` function.";
344+
readonly fix: "A service package's default export must be a factory returning a `DevframeServiceDefinition`, an object with `package`, `version`, `scope`, and a `setup` function.";
345345
};
346346
readonly DF0072: {
347347
readonly why: (p: {

0 commit comments

Comments
 (0)