Skip to content

Commit

Permalink
fix(bonsai-core): add a log just in case (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleroooo authored Jan 13, 2025
1 parent fcb8990 commit 1694dae
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/abacus-ts/websocket/parentSubaccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { MustBigNumber } from '@/lib/numbers';
import { accountRefreshSignal } from '../accountRefreshSignal';
import { createStoreEffect } from '../lib/createStoreEffect';
import { Loadable, loadableIdle, loadableLoaded, loadablePending } from '../lib/loadable';
import { logAbacusTsError } from '../logs';
import { selectParentSubaccountInfo, selectWebsocketUrl } from '../socketSelectors';
import { ChildSubaccountData, ParentSubaccountData } from '../types/rawTypes';
import { makeWsValueManager, subscribeToWsValue } from './lib/indexerValueManagerHelpers';
Expand Down Expand Up @@ -116,7 +117,14 @@ function accountWebsocketValueCreator(
handleUpdates: (baseUpdates, value, fullMessage) => {
const updates = isWsParentSubaccountUpdates(baseUpdates);
const subaccountNumber = fullMessage?.subaccountNumber as number | undefined;
if (value.data == null || updates.length === 0 || subaccountNumber == null) {
if (value.data == null) {
logAbacusTsError(
'ParentSubaccountTracker',
'found unexpectedly null base data in update'
);
return value;
}
if (updates.length === 0 || subaccountNumber == null) {
return value;
}
const resultData = produce(value.data, (returnValue) => {
Expand Down

0 comments on commit 1694dae

Please sign in to comment.