From cbb17a21354534670367bb12deecd2d062bdc266 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 25 Feb 2022 13:25:18 -0600 Subject: [PATCH 1/2] 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; From 5959b73ecbcbbd48aa757cdb721c920beafdb5df Mon Sep 17 00:00:00 2001 From: tomholford Date: Thu, 24 Feb 2022 18:24:13 -0600 Subject: [PATCH 2/2] interface: use single sig in NotificationText The `ProfileOverlay` component expects a `ship` arg as a patp without the sig. This deSigs the ship value used in `NotificationText`. This closes urbit/landscape#1376 --- .../src/views/apps/notifications/notification.tsx | 4 ++-- .../src/views/components/ProfileOverlay.tsx | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/interface/src/views/apps/notifications/notification.tsx b/pkg/interface/src/views/apps/notifications/notification.tsx index d626b1bd5..d55895e90 100644 --- a/pkg/interface/src/views/apps/notifications/notification.tsx +++ b/pkg/interface/src/views/apps/notifications/notification.tsx @@ -8,7 +8,7 @@ import { } from '@urbit/api'; import { BigInteger } from 'big-integer'; import React, { useCallback } from 'react'; -import { useHovering } from '~/logic/lib/util'; +import { deSig, useHovering } from '~/logic/lib/util'; import useLocalState from '~/logic/state/local'; import { StatelessAsyncAction } from '~/views/components/StatelessAsyncAction'; import { SwipeMenu } from '~/views/components/SwipeMenu'; @@ -38,7 +38,7 @@ const NotificationText = ({ contents, ...rest }: NotificationTextProps) => { return ( diff --git a/pkg/interface/src/views/components/ProfileOverlay.tsx b/pkg/interface/src/views/components/ProfileOverlay.tsx index 7e858ae32..d9f26026a 100644 --- a/pkg/interface/src/views/components/ProfileOverlay.tsx +++ b/pkg/interface/src/views/components/ProfileOverlay.tsx @@ -34,11 +34,14 @@ const FixedOverlay = styled(Col)` transition: all 0.1s ease-out; `; -type ProfileOverlayProps = BoxProps & { - ship: string; - children?: ReactNode; - color?: string; -}; +interface ProfileOverlayProps extends BoxProps { + /** + * A valid patp (without sig) + */ + ship: string, + children?: ReactNode, + color?: string, +} const selSettings = (s: SettingsState) => [s.calm.hideAvatars, s.calm.hideNicknames];