@@ -1535,7 +1535,9 @@ return /******/ (function(modules) { // webpackBootstrap |
1535 | 1535 | this._pendingChannelSubscriptions = []; |
1536 | 1536 | this._pendingChannelGroupSubscriptions = []; |
1537 | 1537 |
|
1538 | | - this._timetoken = 0; |
| 1538 | + this._currentTimetoken = 0; |
| 1539 | + this._lastTimetoken = 0; |
| 1540 | + |
1539 | 1541 | this._subscriptionStatusAnnounced = false; |
1540 | 1542 |
|
1541 | 1543 | this._reconnectionManager = new _reconnection_manager2.default({ timeEndpoint: timeEndpoint }); |
@@ -1582,7 +1584,10 @@ return /******/ (function(modules) { // webpackBootstrap |
1582 | 1584 | return; |
1583 | 1585 | } |
1584 | 1586 |
|
1585 | | - if (timetoken) this._timetoken = timetoken; |
| 1587 | + if (timetoken) { |
| 1588 | + this._lastTimetoken = this._currentTimetoken; |
| 1589 | + this._currentTimetoken = timetoken; |
| 1590 | + } |
1586 | 1591 |
|
1587 | 1592 | channels.forEach(function (channel) { |
1588 | 1593 | _this2._channels[channel] = { state: {} }; |
@@ -1626,12 +1631,15 @@ return /******/ (function(modules) { // webpackBootstrap |
1626 | 1631 | this._leaveEndpoint({ channels: channels, channelGroups: channelGroups }, function (status) { |
1627 | 1632 | status.affectedChannels = channels; |
1628 | 1633 | status.affectedChannelGroups = channelGroups; |
| 1634 | + status.currentTimetoken = _this3._currentTimetoken; |
| 1635 | + status.lastTimetoken = _this3._lastTimetoken; |
1629 | 1636 | _this3._listenerManager.announceStatus(status); |
1630 | 1637 | }); |
1631 | 1638 | } |
1632 | 1639 |
|
1633 | 1640 | if (Object.keys(this._channels).length === 0 && Object.keys(this._presenceChannels).length === 0 && Object.keys(this._channelGroups).length === 0 && Object.keys(this._presenceChannelGroups).length === 0) { |
1634 | | - this._timetoken = 0; |
| 1641 | + this._lastTimetoken = 0; |
| 1642 | + this._currentTimetoken = 0; |
1635 | 1643 | this._region = null; |
1636 | 1644 | this._reconnectionManager.stopPolling(); |
1637 | 1645 | } |
@@ -1747,7 +1755,7 @@ return /******/ (function(modules) { // webpackBootstrap |
1747 | 1755 | var subscribeArgs = { |
1748 | 1756 | channels: channels, |
1749 | 1757 | channelGroups: channelGroups, |
1750 | | - timetoken: this._timetoken, |
| 1758 | + timetoken: this._currentTimetoken, |
1751 | 1759 | filterExpression: this._config.filterExpression, |
1752 | 1760 | region: this._region |
1753 | 1761 | }; |
@@ -1769,7 +1777,9 @@ return /******/ (function(modules) { // webpackBootstrap |
1769 | 1777 | _this5._subscriptionStatusAnnounced = true; |
1770 | 1778 | var reconnectedAnnounce = { |
1771 | 1779 | category: _categories2.default.PNReconnectedCategory, |
1772 | | - operation: status.operation |
| 1780 | + operation: status.operation, |
| 1781 | + lastTimetoken: _this5._lastTimetoken, |
| 1782 | + currentTimetoken: _this5._currentTimetoken |
1773 | 1783 | }; |
1774 | 1784 | _this5._listenerManager.announceStatus(reconnectedAnnounce); |
1775 | 1785 | }); |
@@ -1782,12 +1792,17 @@ return /******/ (function(modules) { // webpackBootstrap |
1782 | 1792 | return; |
1783 | 1793 | } |
1784 | 1794 |
|
| 1795 | + this._lastTimetoken = this._currentTimetoken; |
| 1796 | + this._currentTimetoken = payload.metadata.timetoken; |
| 1797 | + |
1785 | 1798 | if (!this._subscriptionStatusAnnounced) { |
1786 | 1799 | var connectedAnnounce = {}; |
1787 | 1800 | connectedAnnounce.category = _categories2.default.PNConnectedCategory; |
1788 | 1801 | connectedAnnounce.operation = status.operation; |
1789 | 1802 | connectedAnnounce.affectedChannels = this._pendingChannelSubscriptions; |
1790 | 1803 | connectedAnnounce.affectedChannelGroups = this._pendingChannelGroupSubscriptions; |
| 1804 | + connectedAnnounce.lastTimetoken = this._lastTimetoken; |
| 1805 | + connectedAnnounce.currentTimetoken = this._currentTimetoken; |
1791 | 1806 | this._subscriptionStatusAnnounced = true; |
1792 | 1807 | this._listenerManager.announceStatus(connectedAnnounce); |
1793 | 1808 |
|
@@ -1873,7 +1888,6 @@ return /******/ (function(modules) { // webpackBootstrap |
1873 | 1888 | }); |
1874 | 1889 |
|
1875 | 1890 | this._region = payload.metadata.region; |
1876 | | - this._timetoken = payload.metadata.timetoken; |
1877 | 1891 | this._startSubscribeLoop(); |
1878 | 1892 | } |
1879 | 1893 | }, { |
|