@electric-sql/client 1.5.9 → 1.5.10
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/cjs/index.cjs +31 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.browser.mjs +4 -4
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.legacy-esm.js +31 -3
- package/dist/index.legacy-esm.js.map +1 -1
- package/dist/index.mjs +31 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/shape-stream-state.ts +72 -35
package/dist/cjs/index.cjs
CHANGED
|
@@ -1719,7 +1719,7 @@ var PausedState = class _PausedState extends ShapeStreamState {
|
|
|
1719
1719
|
constructor(previousState) {
|
|
1720
1720
|
super();
|
|
1721
1721
|
this.kind = `paused`;
|
|
1722
|
-
this.previousState = previousState;
|
|
1722
|
+
this.previousState = previousState instanceof _PausedState ? previousState.previousState : previousState;
|
|
1723
1723
|
}
|
|
1724
1724
|
get handle() {
|
|
1725
1725
|
return this.previousState.handle;
|
|
@@ -1759,7 +1759,20 @@ var PausedState = class _PausedState extends ShapeStreamState {
|
|
|
1759
1759
|
if (transition.action === `accepted`) {
|
|
1760
1760
|
return { action: `accepted`, state: new _PausedState(transition.state) };
|
|
1761
1761
|
}
|
|
1762
|
-
|
|
1762
|
+
if (transition.action === `ignored`) {
|
|
1763
|
+
return { action: `ignored`, state: this };
|
|
1764
|
+
}
|
|
1765
|
+
if (transition.action === `stale-retry`) {
|
|
1766
|
+
return {
|
|
1767
|
+
action: `stale-retry`,
|
|
1768
|
+
state: new _PausedState(transition.state),
|
|
1769
|
+
exceededMaxRetries: transition.exceededMaxRetries
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
const _exhaustive = transition;
|
|
1773
|
+
throw new Error(
|
|
1774
|
+
`PausedState.handleResponseMetadata: unhandled transition action "${_exhaustive.action}"`
|
|
1775
|
+
);
|
|
1763
1776
|
}
|
|
1764
1777
|
withHandle(handle) {
|
|
1765
1778
|
return new _PausedState(this.previousState.withHandle(handle));
|
|
@@ -1778,7 +1791,7 @@ var ErrorState = class _ErrorState extends ShapeStreamState {
|
|
|
1778
1791
|
constructor(previousState, error) {
|
|
1779
1792
|
super();
|
|
1780
1793
|
this.kind = `error`;
|
|
1781
|
-
this.previousState = previousState;
|
|
1794
|
+
this.previousState = previousState instanceof _ErrorState ? previousState.previousState : previousState;
|
|
1782
1795
|
this.error = error;
|
|
1783
1796
|
}
|
|
1784
1797
|
get handle() {
|
|
@@ -1799,6 +1812,21 @@ var ErrorState = class _ErrorState extends ShapeStreamState {
|
|
|
1799
1812
|
get isUpToDate() {
|
|
1800
1813
|
return this.previousState.isUpToDate;
|
|
1801
1814
|
}
|
|
1815
|
+
get staleCacheBuster() {
|
|
1816
|
+
return this.previousState.staleCacheBuster;
|
|
1817
|
+
}
|
|
1818
|
+
get staleCacheRetryCount() {
|
|
1819
|
+
return this.previousState.staleCacheRetryCount;
|
|
1820
|
+
}
|
|
1821
|
+
get sseFallbackToLongPolling() {
|
|
1822
|
+
return this.previousState.sseFallbackToLongPolling;
|
|
1823
|
+
}
|
|
1824
|
+
get consecutiveShortSseConnections() {
|
|
1825
|
+
return this.previousState.consecutiveShortSseConnections;
|
|
1826
|
+
}
|
|
1827
|
+
get replayCursor() {
|
|
1828
|
+
return this.previousState.replayCursor;
|
|
1829
|
+
}
|
|
1802
1830
|
withHandle(handle) {
|
|
1803
1831
|
return new _ErrorState(this.previousState.withHandle(handle), this.error);
|
|
1804
1832
|
}
|