@dxos/messaging 0.3.8 → 0.3.9-main.14901ff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +25 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +24 -14
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/signal-manager/websocket-signal-manager.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/signal-manager/websocket-signal-manager.ts +6 -3
|
@@ -8,7 +8,7 @@ import { Context } from '@dxos/context';
|
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { PublicKey } from '@dxos/keys';
|
|
10
10
|
import { log } from '@dxos/log';
|
|
11
|
-
import { RateLimitExceededError, trace } from '@dxos/protocols';
|
|
11
|
+
import { RateLimitExceededError, TimeoutError, trace } from '@dxos/protocols';
|
|
12
12
|
import { type Runtime } from '@dxos/protocols/proto/dxos/config';
|
|
13
13
|
import { type SwarmEvent } from '@dxos/protocols/proto/dxos/mesh/signal';
|
|
14
14
|
|
|
@@ -135,9 +135,12 @@ export class WebsocketSignalManager implements SignalManager {
|
|
|
135
135
|
void this._forEachServer(async (server, serverName) => {
|
|
136
136
|
void server.sendMessage({ author, recipient, payload }).catch((err) => {
|
|
137
137
|
if (err instanceof RateLimitExceededError) {
|
|
138
|
-
log('WSS rate limit exceeded', { err });
|
|
138
|
+
log.info('WSS rate limit exceeded', { err });
|
|
139
|
+
} else if (err instanceof TimeoutError || err.constructor.name === 'TimeoutError') {
|
|
140
|
+
log.info('WSS sendMessage timeout', { err });
|
|
141
|
+
void this.checkServerFailure(serverName);
|
|
139
142
|
} else {
|
|
140
|
-
log(`error sending to ${serverName}`, { err });
|
|
143
|
+
log.info(`error sending to ${serverName}`, { err });
|
|
141
144
|
void this.checkServerFailure(serverName);
|
|
142
145
|
}
|
|
143
146
|
});
|