From cbb17a21354534670367bb12deecd2d062bdc266 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 25 Feb 2022 13:25:18 -0600 Subject: [PATCH] interface: fix subscription reconnect issues Restores subscription reconnect issues by correctly throwing a FatalError so that subscriptions are correctly restarted --- pkg/grid/src/state/base.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/grid/src/state/base.ts b/pkg/grid/src/state/base.ts index 9c2efe232..5041cf649 100644 --- a/pkg/grid/src/state/base.ts +++ b/pkg/grid/src/state/base.ts @@ -4,7 +4,7 @@ import { compose } from 'lodash/fp'; import _ from 'lodash'; import create, { GetState, SetState, UseStore } from 'zustand'; import { persist } from 'zustand/middleware'; -import Urbit, { SubscriptionRequestInterface } from '@urbit/http-api'; +import Urbit, { FatalError, SubscriptionRequestInterface } from '@urbit/http-api'; import { Poke } from '@urbit/api'; import api from './api'; import { clearStorageMigration, createStorageKey, storageVersion, useMockData } from './util'; @@ -107,7 +107,9 @@ export function createSubscription( path, event: e, err: () => {}, - quit: () => {} + quit: () => { + throw new FatalError("subscription clogged"); + } }; // TODO: err, quit handling (resubscribe?) return request;