fix(core): selfhosted auth handling (#15295)

fix #15284
fix #15266
fix #15268
fix #15267

#### PR Dependency Tree


* **PR #15295** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
DarkSky
2026-07-21 11:26:15 +08:00
committed by GitHub
parent bb55d6fd21
commit b1abd8db54
17 changed files with 169 additions and 65 deletions
@@ -186,17 +186,27 @@ export abstract class AutoReconnectConnection<
return;
}
if (signal?.aborted) {
reject(signal.reason);
return;
}
const off = this.onStatusChanged(status => {
if (status === 'connected') {
resolve();
off();
cleanup();
}
});
signal?.addEventListener('abort', reason => {
reject(reason);
const onAbort = () => {
reject(signal?.reason);
cleanup();
};
const cleanup = () => {
off();
});
signal?.removeEventListener('abort', onAbort);
};
signal?.addEventListener('abort', onAbort, { once: true });
});
}