@opentap/runner-client 2.3.4-alpha.1.1 → 2.3.5-alpha.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.
package/lib/BaseClient.js CHANGED
@@ -110,11 +110,11 @@ var BaseClient = /** @class */ (function () {
110
110
  * @returns Promise of an object
111
111
  */
112
112
  BaseClient.prototype.request = function (subject, payload, options) {
113
- var _a, _b, _c;
113
+ var _a, _b;
114
114
  return __awaiter(this, void 0, void 0, function () {
115
- var data, headers, timeout, replySubject, chunkSize, requestId, opts, fileDescriptor, chunkNumber, getChunk, subscription, responsePromise, chunk, i;
115
+ var data, headers, timeout, replySubject, serverMaxPayload, chunkSize, requestId, opts, fileDescriptor, chunkNumber, getChunk, subscription, responsePromise, chunk, i;
116
116
  var _this = this;
117
- return __generator(this, function (_d) {
117
+ return __generator(this, function (_c) {
118
118
  // Prepend the base subject if the given subject does not start with that
119
119
  if (!(options === null || options === void 0 ? void 0 : options.fullSubject)) {
120
120
  subject = "".concat(this.baseSubject, ".Request.").concat(subject);
@@ -127,7 +127,8 @@ var BaseClient = /** @class */ (function () {
127
127
  headers = this.buildHeaders();
128
128
  timeout = (options === null || options === void 0 ? void 0 : options.timeout) || this.timeout;
129
129
  replySubject = uuidv4();
130
- chunkSize = ((_c = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.max_payload) !== null && _c !== void 0 ? _c : 512000) - 2000;
130
+ serverMaxPayload = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.max_payload;
131
+ chunkSize = serverMaxPayload ? serverMaxPayload - 50000 : 512000;
131
132
  // The Session and the Client need to agree on the chunk size. Put it in a header.
132
133
  headers.append('ChunkSize', chunkSize.toString());
133
134
  requestId = uuidv4();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.3.4-alpha.1.1",
3
+ "version": "2.3.5-alpha.1.1",
4
4
  "description": "This is the web client for the OpenTAP Runner.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",