|
4068 | 4068 | /** |
4069 | 4069 | * Whether PubNub client should catch up subscription after network issues. |
4070 | 4070 | */ |
4071 | | - const RESTORE = false; |
| 4071 | + const RESTORE = true; |
4072 | 4072 | /** |
4073 | 4073 | * Whether network availability change should be announced with `PNNetworkDownCategory` and |
4074 | 4074 | * `PNNetworkUpCategory` state or not. |
|
4089 | 4089 | /** |
4090 | 4090 | * Whether subscription event engine should be used or not. |
4091 | 4091 | */ |
4092 | | - const ENABLE_EVENT_ENGINE = false; |
| 4092 | + const ENABLE_EVENT_ENGINE = true; |
4093 | 4093 | /** |
4094 | 4094 | * Whether configured user presence state should be maintained by the PubNub client or not. |
4095 | 4095 | */ |
|
4991 | 4991 | validate() { |
4992 | 4992 | if (this.delay < 2) |
4993 | 4993 | throw new Error('Delay can not be set less than 2 seconds for retry'); |
4994 | | - if (this.maximumRetry > 10) |
4995 | | - throw new Error('Maximum retry for linear retry policy can not be more than 10'); |
4996 | 4994 | }, |
4997 | 4995 | }; |
4998 | 4996 | } |
|
5017 | 5015 | validate() { |
5018 | 5016 | if (this.minimumDelay < 2) |
5019 | 5017 | throw new Error('Minimum delay can not be set less than 2 seconds for retry'); |
5020 | | - else if (this.maximumDelay > 150) |
5021 | | - throw new Error('Maximum delay can not be set more than 150 seconds for' + ' retry'); |
5022 | | - else if (this.maximumRetry > 6) |
5023 | | - throw new Error('Maximum retry for exponential retry policy can not be more than 6'); |
5024 | 5018 | }, |
5025 | 5019 | }; |
5026 | 5020 | } |
|
5438 | 5432 | return base.PubNubFile; |
5439 | 5433 | }, |
5440 | 5434 | get version() { |
5441 | | - return '10.2.9'; |
| 5435 | + return '11.0.0'; |
5442 | 5436 | }, |
5443 | 5437 | getVersion() { |
5444 | 5438 | return this.version; |
|
9307 | 9301 | category: StatusCategory$1.PNConnectedCategory, |
9308 | 9302 | affectedChannels: context.channels.slice(0), |
9309 | 9303 | affectedChannelGroups: context.groups.slice(0), |
| 9304 | + operation: RequestOperation$1.PNSubscribeOperation, |
9310 | 9305 | currentTimetoken: !!((_d = context.cursor) === null || _d === void 0 ? void 0 : _d.timetoken) ? (_e = context.cursor) === null || _e === void 0 ? void 0 : _e.timetoken : payload.timetoken, |
9311 | 9306 | }), |
9312 | 9307 | ]); |
|
9464 | 9459 | return UnsubscribedState.with(undefined, [ |
9465 | 9460 | emitStatus(Object.assign({ category: !payload.isOffline |
9466 | 9461 | ? StatusCategory$1.PNDisconnectedCategory |
9467 | | - : StatusCategory$1.PNDisconnectedUnexpectedlyCategory }, (errorCategory ? { error: errorCategory } : {}))), |
| 9462 | + : StatusCategory$1.PNDisconnectedUnexpectedlyCategory, operation: RequestOperation$1.PNUnsubscribeOperation }, (errorCategory ? { error: errorCategory } : {}))), |
9468 | 9463 | ]); |
9469 | 9464 | } |
9470 | 9465 | return ReceivingState.with({ |
|
9510 | 9505 | var _a; |
9511 | 9506 | if (!event.payload.isOffline) { |
9512 | 9507 | return ReceiveStoppedState.with(Object.assign({}, context), [ |
9513 | | - emitStatus({ category: StatusCategory$1.PNDisconnectedCategory }), |
| 9508 | + emitStatus({ |
| 9509 | + category: StatusCategory$1.PNDisconnectedCategory, |
| 9510 | + operation: RequestOperation$1.PNSubscribeOperation, |
| 9511 | + }), |
9514 | 9512 | ]); |
9515 | 9513 | } |
9516 | 9514 | else { |
9517 | 9515 | const errorReason = PubNubAPIError.create(new Error('Network connection error')).toPubNubError(RequestOperation$1.PNSubscribeOperation); |
9518 | 9516 | return ReceiveFailedState.with(Object.assign(Object.assign({}, context), { reason: errorReason }), [ |
9519 | 9517 | emitStatus({ |
9520 | 9518 | category: StatusCategory$1.PNDisconnectedUnexpectedlyCategory, |
| 9519 | + operation: RequestOperation$1.PNSubscribeOperation, |
9521 | 9520 | error: (_a = errorReason.status) === null || _a === void 0 ? void 0 : _a.category, |
9522 | 9521 | }), |
9523 | 9522 | ]); |
9524 | 9523 | } |
9525 | 9524 | }); |
9526 | | - ReceivingState.on(unsubscribeAll.type, (_) => UnsubscribedState.with(undefined, [emitStatus({ category: StatusCategory$1.PNDisconnectedCategory })])); |
| 9525 | + ReceivingState.on(unsubscribeAll.type, (_) => UnsubscribedState.with(undefined, [ |
| 9526 | + emitStatus({ |
| 9527 | + category: StatusCategory$1.PNDisconnectedCategory, |
| 9528 | + operation: RequestOperation$1.PNUnsubscribeOperation, |
| 9529 | + }), |
| 9530 | + ])); |
9527 | 9531 |
|
9528 | 9532 | /** |
9529 | 9533 | * Subscribe Event Engine effects dispatcher. |
|
0 commit comments