@dronedeploy/rocos-js-sdk 3.1.0 → 3.1.1

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.
@@ -30,6 +30,12 @@ class TelemetryStreamConnect extends TelemetryStreamAbstract_1.TelemetryStreamAb
30
30
  // payloads containing control characters (verified against a live robot on dev) and is
31
31
  // less efficient. Binary is required for correctness here.
32
32
  useBinaryFormat: true,
33
+ // Optional caller-supplied fetch. Pass a reference captured before page-level instrumentation
34
+ // (e.g. Datadog RUM) monkey-patches `window.fetch`: RUM clones and reads every fetch response
35
+ // to measure timing, and on this long-lived server-stream that clone-read stalls connect-web's
36
+ // read (stream connects 200 but yields no frames). When omitted, connect-web uses the global
37
+ // fetch. See docs/connect-rpc-investigation.md.
38
+ ...(config.fetch ? { fetch: config.fetch } : {}),
33
39
  });
34
40
  this.client = (0, connect_1.createClient)(teletubby_pb_1.TelemetryGateway, transport);
35
41
  }
@@ -12,6 +12,7 @@ interface ConfigBase {
12
12
  port?: number;
13
13
  insecure?: boolean;
14
14
  transport?: TelemetryTransport;
15
+ fetch?: typeof globalThis.fetch;
15
16
  hooks?: {
16
17
  http?: {
17
18
  onResponse?: (res: Response) => void;
@@ -9,4 +9,5 @@ export interface IStreamConfig {
9
9
  insecure?: boolean;
10
10
  transport?: TelemetryTransport;
11
11
  grpcWebFormat?: 'text' | 'binary';
12
+ fetch?: typeof globalThis.fetch;
12
13
  }
@@ -164,6 +164,7 @@ class TelemetryService extends BaseStreamService_1.BaseStreamService {
164
164
  port: this.config.port,
165
165
  insecure: this.config.insecure,
166
166
  transport: this.config.transport,
167
+ fetch: this.config.fetch,
167
168
  });
168
169
  if (!newStream.isNew) {
169
170
  newStream.stream.statusStream$.subscribe((msg) => {
@@ -27,6 +27,12 @@ export class TelemetryStreamConnect extends TelemetryStreamAbstract {
27
27
  // payloads containing control characters (verified against a live robot on dev) and is
28
28
  // less efficient. Binary is required for correctness here.
29
29
  useBinaryFormat: true,
30
+ // Optional caller-supplied fetch. Pass a reference captured before page-level instrumentation
31
+ // (e.g. Datadog RUM) monkey-patches `window.fetch`: RUM clones and reads every fetch response
32
+ // to measure timing, and on this long-lived server-stream that clone-read stalls connect-web's
33
+ // read (stream connects 200 but yields no frames). When omitted, connect-web uses the global
34
+ // fetch. See docs/connect-rpc-investigation.md.
35
+ ...(config.fetch ? { fetch: config.fetch } : {}),
30
36
  });
31
37
  this.client = createClient(TelemetryGateway, transport);
32
38
  }
@@ -12,6 +12,7 @@ interface ConfigBase {
12
12
  port?: number;
13
13
  insecure?: boolean;
14
14
  transport?: TelemetryTransport;
15
+ fetch?: typeof globalThis.fetch;
15
16
  hooks?: {
16
17
  http?: {
17
18
  onResponse?: (res: Response) => void;
@@ -9,4 +9,5 @@ export interface IStreamConfig {
9
9
  insecure?: boolean;
10
10
  transport?: TelemetryTransport;
11
11
  grpcWebFormat?: 'text' | 'binary';
12
+ fetch?: typeof globalThis.fetch;
12
13
  }
@@ -161,6 +161,7 @@ export class TelemetryService extends BaseStreamService {
161
161
  port: this.config.port,
162
162
  insecure: this.config.insecure,
163
163
  transport: this.config.transport,
164
+ fetch: this.config.fetch,
164
165
  });
165
166
  if (!newStream.isNew) {
166
167
  newStream.stream.statusStream$.subscribe((msg) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",