mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-29 04:04:02 +03:00
interface: fix subscription reconnect issues
Restores subscription reconnect issues by correctly throwing a FatalError so that subscriptions are correctly restarted
This commit is contained in:
parent
47338cffc6
commit
cbb17a2135
@ -4,7 +4,7 @@ import { compose } from 'lodash/fp';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import create, { GetState, SetState, UseStore } from 'zustand';
|
import create, { GetState, SetState, UseStore } from 'zustand';
|
||||||
import { persist } from 'zustand/middleware';
|
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 { Poke } from '@urbit/api';
|
||||||
import api from './api';
|
import api from './api';
|
||||||
import { clearStorageMigration, createStorageKey, storageVersion, useMockData } from './util';
|
import { clearStorageMigration, createStorageKey, storageVersion, useMockData } from './util';
|
||||||
@ -107,7 +107,9 @@ export function createSubscription(
|
|||||||
path,
|
path,
|
||||||
event: e,
|
event: e,
|
||||||
err: () => {},
|
err: () => {},
|
||||||
quit: () => {}
|
quit: () => {
|
||||||
|
throw new FatalError("subscription clogged");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// TODO: err, quit handling (resubscribe?)
|
// TODO: err, quit handling (resubscribe?)
|
||||||
return request;
|
return request;
|
||||||
|
Loading…
Reference in New Issue
Block a user