fix: annotate the seat-lookup catch so the baselined typecheck passes

This commit is contained in:
Juan Castro committed 2026-09-25 14:39:23 -04:00
1 parent 176c8848f5
commit ee3f928b0e
1 file changed
+4 -8
+4 -8
View File
@@ -390,7 +390,7 @@ export class SocketService extends PuterService {
}
)
?.getOrgSeat?.(id)
.catch(() => null);
.catch((): null => null);
return { ...base, teamRequires2fa: Number(seat?.require_2fa) === 1 };
}
@@ -408,8 +408,7 @@ export class SocketService extends PuterService {
// `{ auth: { ... } }`, not the query string. puter-js uses
// `io(url, { auth: { auth_token } })`.
const handshakeAuth = socket.handshake.auth as
| Record<string, unknown>
| undefined;
Record<string, unknown> | undefined;
const tokenRaw =
typeof handshakeAuth?.auth_token === 'string'
? handshakeAuth.auth_token
@@ -857,8 +856,7 @@ export class SocketService extends PuterService {
// their next poll of /cache/last-change-timestamp.
const originalSocketId = (
data.response as
| { original_client_socket_id?: string }
| undefined
{ original_client_socket_id?: string } | undefined
)?.original_client_socket_id;
await this.send({ room: userId }, 'cache.updated', {
timestamp,
@@ -872,9 +870,7 @@ export class SocketService extends PuterService {
#handleUploadProgress(data: UploadProgressPayload): void {
const meta = data.meta ?? {};
const userId = (meta.user_id ?? meta.userId) as
| number
| string
| undefined;
number | string | undefined;
if (!userId) {
console.warn('[socket] upload-progress missing user_id', { meta });
return;