@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/index.mjs CHANGED
@@ -1682,7 +1682,7 @@ var PausedState = class _PausedState extends ShapeStreamState {
1682
1682
  constructor(previousState) {
1683
1683
  super();
1684
1684
  this.kind = `paused`;
1685
- this.previousState = previousState;
1685
+ this.previousState = previousState instanceof _PausedState ? previousState.previousState : previousState;
1686
1686
  }
1687
1687
  get handle() {
1688
1688
  return this.previousState.handle;
@@ -1722,7 +1722,20 @@ var PausedState = class _PausedState extends ShapeStreamState {
1722
1722
  if (transition.action === `accepted`) {
1723
1723
  return { action: `accepted`, state: new _PausedState(transition.state) };
1724
1724
  }
1725
- return transition;
1725
+ if (transition.action === `ignored`) {
1726
+ return { action: `ignored`, state: this };
1727
+ }
1728
+ if (transition.action === `stale-retry`) {
1729
+ return {
1730
+ action: `stale-retry`,
1731
+ state: new _PausedState(transition.state),
1732
+ exceededMaxRetries: transition.exceededMaxRetries
1733
+ };
1734
+ }
1735
+ const _exhaustive = transition;
1736
+ throw new Error(
1737
+ `PausedState.handleResponseMetadata: unhandled transition action "${_exhaustive.action}"`
1738
+ );
1726
1739
  }
1727
1740
  withHandle(handle) {
1728
1741
  return new _PausedState(this.previousState.withHandle(handle));
@@ -1741,7 +1754,7 @@ var ErrorState = class _ErrorState extends ShapeStreamState {
1741
1754
  constructor(previousState, error) {
1742
1755
  super();
1743
1756
  this.kind = `error`;
1744
- this.previousState = previousState;
1757
+ this.previousState = previousState instanceof _ErrorState ? previousState.previousState : previousState;
1745
1758
  this.error = error;
1746
1759
  }
1747
1760
  get handle() {
@@ -1762,6 +1775,21 @@ var ErrorState = class _ErrorState extends ShapeStreamState {
1762
1775
  get isUpToDate() {
1763
1776
  return this.previousState.isUpToDate;
1764
1777
  }
1778
+ get staleCacheBuster() {
1779
+ return this.previousState.staleCacheBuster;
1780
+ }
1781
+ get staleCacheRetryCount() {
1782
+ return this.previousState.staleCacheRetryCount;
1783
+ }
1784
+ get sseFallbackToLongPolling() {
1785
+ return this.previousState.sseFallbackToLongPolling;
1786
+ }
1787
+ get consecutiveShortSseConnections() {
1788
+ return this.previousState.consecutiveShortSseConnections;
1789
+ }
1790
+ get replayCursor() {
1791
+ return this.previousState.replayCursor;
1792
+ }
1765
1793
  withHandle(handle) {
1766
1794
  return new _ErrorState(this.previousState.withHandle(handle), this.error);
1767
1795
  }