diff --git a/ts/state/ducks/accounts.preload.ts b/ts/state/ducks/accounts.preload.ts index 15ad58c954..742f834f8a 100644 --- a/ts/state/ducks/accounts.preload.ts +++ b/ts/state/ducks/accounts.preload.ts @@ -14,7 +14,7 @@ import type { ServiceIdString } from '../../types/ServiceId.std.ts'; import { getServiceIdsForE164s } from '../../util/getServiceIdsForE164s.dom.ts'; import { useBoundActions } from '../../hooks/useBoundActions.std.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; const log = createLogger('accounts'); @@ -76,10 +76,7 @@ function checkForAccount( phoneNumber ); if (existing) { - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('checkForAccount')); return; } diff --git a/ts/state/ducks/calling.preload.ts b/ts/state/ducks/calling.preload.ts index f61d1e0490..be64404a76 100644 --- a/ts/state/ducks/calling.preload.ts +++ b/ts/state/ducks/calling.preload.ts @@ -128,7 +128,7 @@ import { } from '../../textsecure/WebAPI.preload.ts'; import { itemStorage } from '../../textsecure/Storage.preload.ts'; import type { SizeCallbackType } from '../../calling/VideoSupport.preload.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import type { SignalService } from '../../protobuf/index.std.ts'; const { omit } = lodash; @@ -1298,10 +1298,7 @@ function sendRemoteMute( } calling.sendRemoteMute(activeCall.conversationId, demuxId); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('sendRemoteMute')); }; } diff --git a/ts/state/ducks/composer.preload.ts b/ts/state/ducks/composer.preload.ts index 57aaed0313..2f5e62c34b 100644 --- a/ts/state/ducks/composer.preload.ts +++ b/ts/state/ducks/composer.preload.ts @@ -29,7 +29,7 @@ import type { PinMessageData, ReadonlyMessageAttributesType, } from '../../model-types.d.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import type { ShowToastActionType } from './toast.preload.ts'; import type { StateType as RootStateType } from '../reducer.preload.ts'; import { createLogger } from '../../logging/log.std.ts'; @@ -332,10 +332,7 @@ function onClearAttachments(conversationId: string): NoopActionType { conversation.get('draftAttachments') ); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('onClearAttachments'); } function cancelJoinRequest(conversationId: string): NoopActionType { @@ -350,20 +347,14 @@ function cancelJoinRequest(conversationId: string): NoopActionType { task: async () => conversation.cancelJoinRequest(), }); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('cancelJoinRequest'); } function onCloseLinkPreview(conversationId: string): NoopActionType { suspendLinkPreviews(); removeLinkPreview(conversationId); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('onCloseLinkPreview'); } function onTextTooLong(): ShowToastActionType { @@ -806,10 +797,7 @@ function sendStickerMessage( log.error('clickSend error:', Errors.toLogFormat(error)); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('sendStickerMessage')); }; } @@ -855,10 +843,7 @@ function sendPoll( log.error('sendPoll error:', Errors.toLogFormat(error)); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('sendPoll')); }; } @@ -1156,10 +1141,7 @@ function onEditorStateChange({ conversationId, }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('onEditorStateChange')); }; } @@ -1283,10 +1265,7 @@ function processAttachments({ return; } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('processAttachments')); }; } @@ -1467,10 +1446,7 @@ function reactToMessage( emoji, remove, }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('reactToMessage')); } catch (error) { log.error( 'reactToMessage: Error sending reaction', @@ -1499,10 +1475,7 @@ function endPoll( return async dispatch => { try { await enqueuePollTerminateForSend({ messageId }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('endPoll')); } catch (error) { log.error('endPoll: Error sending poll terminate', error, messageId); dispatch({ diff --git a/ts/state/ducks/conversations.preload.ts b/ts/state/ducks/conversations.preload.ts index 6e2a1d02d4..eff3ea1dc3 100644 --- a/ts/state/ducks/conversations.preload.ts +++ b/ts/state/ducks/conversations.preload.ts @@ -121,7 +121,7 @@ import { markViewed as messageUpdaterMarkViewed } from '../../services/MessageUp import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.ts'; import { useBoundActions } from '../../hooks/useBoundActions.std.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import { conversationJobQueue, conversationQueueJobEnum, @@ -1389,10 +1389,7 @@ function acknowledgeGroupMemberNameCollisions( conversation.acknowledgeGroupMemberNameCollisions(groupNameCollisions); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('acknowledgeGroupMemberNameCollisions'); } function blockGroupLinkRequests( conversationId: string, @@ -1405,10 +1402,7 @@ function blockGroupLinkRequests( void conversation.blockGroupLinkRequests(serviceId); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('blockGroupLinkRequests'); } function loadNewerMessages( conversationId: string, @@ -1421,10 +1415,7 @@ function loadNewerMessages( void conversation.loadNewerMessages(newestMessageId); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('loadNewerMessages'); } function loadNewestMessages( conversationId: string, @@ -1438,10 +1429,7 @@ function loadNewestMessages( void conversation.loadNewestMessages(newestMessageId, setFocus); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('loadNewestMessages'); } function loadOlderMessages( @@ -1454,10 +1442,7 @@ function loadOlderMessages( } void conversation.loadOlderMessages(oldestMessageId); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('loadOlderMessages'); } function _getAllConversationsInChatFolder( @@ -1571,10 +1556,7 @@ function removeMember( task: () => conversation.removeFromGroupV2(memberConversationId), }); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('removeMember'); } function filterAvatarData( @@ -1665,10 +1647,7 @@ function changeHasGroupLink( idForLogging: conversation.idForLogging(), task: async () => conversation.toggleGroupLink(value), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('changeHasGroupLink')); }; } @@ -1687,10 +1666,7 @@ function setAnnouncementsOnly( idForLogging: conversation.idForLogging(), task: async () => conversation.updateAnnouncementsOnly(value), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('setAnnouncementsOnly')); }; } @@ -1709,10 +1685,7 @@ function setAccessControlMembersSetting( idForLogging: conversation.idForLogging(), task: async () => conversation.updateAccessControlMembers(value), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('setAccessControlMembersSetting')); }; } @@ -1733,10 +1706,7 @@ function setAccessControlMemberLabelSetting( idForLogging: conversation.idForLogging(), task: async () => conversation.updateAccessControlMemberLabel(value), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('setAccessControlMemberLabelSetting')); }; } @@ -1757,10 +1727,7 @@ function setAccessControlAttributesSetting( idForLogging: conversation.idForLogging(), task: async () => conversation.updateAccessControlAttributes(value), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('setAccessControlAttributesSetting')); }; } @@ -1785,10 +1752,7 @@ function setDisappearingMessages( version: undefined, }), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('setDisappearingMessages')); }; } @@ -1803,10 +1767,7 @@ function setDontNotifyForMentionsIfMuted( conversation.setDontNotifyForMentionsIfMuted(newValue); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('setDontNotifyForMentionsIfMuted'); } function setChatFolderMuteExpiration( @@ -1840,10 +1801,7 @@ function setMuteExpiration( : Date.now() + muteExpiresAt ); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('setMuteExpiration'); } function setPinned( @@ -1874,10 +1832,7 @@ function setPinned( conversation.unpin(); } - return { - type: 'NOOP', - payload: null, - }; + return noopAction('setPinned'); } function deleteMessages({ @@ -2013,10 +1968,7 @@ function destroyMessages( }, }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('destroyMessages')); }; } @@ -2143,10 +2095,7 @@ function generateNewGroupLink( task: async () => conversation.refreshGroupLink(), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('generateNewGroupLink')); }; } @@ -2243,10 +2192,7 @@ function setAccessControlAddFromInviteLinkSetting( conversation.updateAccessControlAddFromInviteLink(value), }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('setAccessControlAddFromInviteLinkSetting')); }; } @@ -2454,10 +2400,7 @@ function kickOffAttachmentDownload( drop(window.MessageCache.saveMessage(message.attributes)); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('kickOffAttachmentDownload')); }; } @@ -2494,10 +2437,7 @@ function cancelAttachmentDownload({ await DataWriter.removeAttachmentDownloadJobsForMessage(messageId); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('cancelAttachmentDownload')); }; } @@ -2512,10 +2452,7 @@ function markAttachmentAsCorrupted( return async dispatch => { await doMarkAttachmentAsCorrupted(options.messageId, options.attachment); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('markAttachmentAsCorrupted')); }; } @@ -2640,10 +2577,7 @@ function retryMessageSend( ); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('retryMessageSend')); }; } @@ -2662,10 +2596,7 @@ function sendPollVote({ // TODO DESKTOP-9343: show toast on exception } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('sendPollVote')); }; } @@ -2681,10 +2612,7 @@ export function copyMessageText( const body = getNotificationTextForMessage(message.attributes); clipboard.writeText(body); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('copyMessageText')); }; } @@ -2735,10 +2663,7 @@ export function retryDeleteForEveryone( ); await conversationJobQueue.add(jobData); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('retryDeleteForEveryone')); } catch (error) { log.error( 'retryDeleteForEveryone: Failed to queue delete for everyone', @@ -3179,10 +3104,7 @@ function terminateGroup( ); } } else { - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('terminateGroup')); } } catch { dispatch({ @@ -3313,10 +3235,7 @@ function getProfilesForConversation(conversationId: string): NoopActionType { drop(conversation.getProfiles()); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('getProfilesForConversation'); } function conversationStoppedByMissingVerification(payload: { @@ -3675,10 +3594,7 @@ function deleteMessagesForEveryone( }, }); } else { - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('deleteMessagesForEveryone')); } }; } @@ -3740,10 +3656,7 @@ function approvePendingMembershipFromGroupV2( }); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('approvePendingMembershipFromGroupV2')); }; } @@ -3817,10 +3730,7 @@ function revokePendingMembershipsFromGroupV2( }); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('revokePendingMembershipsFromGroupV2')); }; } @@ -4067,10 +3977,7 @@ function acceptConversation( } } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('acceptConversation')); }; } @@ -4146,10 +4053,7 @@ function blockConversation( } } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('blockConversation')); }; } @@ -4184,10 +4088,7 @@ function deleteConversation( await conversation.destroyMessages({ source: 'local-delete' }); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('deleteConversation')); }; } @@ -4205,10 +4106,7 @@ function initiateMigrationToGroupV2(conversationId: string): NoopActionType { task: () => doInitiateMigrationToGroupV2(conversation), }); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('initiateMigrationToGroupV2'); } export type SaveAttachmentActionCreatorType = ReadonlyDeep< @@ -4612,10 +4510,7 @@ function toggleHideStories( if (conversationModel) { conversationModel.toggleHideStories(); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('toggleHideStories')); }; } @@ -4633,10 +4528,7 @@ function removeMemberFromGroup( task: () => conversationModel.removeFromGroupV2(contactId), }); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('removeMemberFromGroup')); }; } @@ -4812,10 +4704,7 @@ function toggleGroupsForStorySend( }) ); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('toggleGroupsForStorySend')); }; } @@ -4828,10 +4717,7 @@ function toggleAdmin( if (conversationModel) { void conversationModel.toggleAdmin(contactId); } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('toggleAdmin')); }; } @@ -5134,10 +5020,7 @@ function doubleCheckMissingQuoteReference(messageId: string): NoopActionType { drop(doDoubleCheckMissingQuoteReference(message)); } - return { - type: 'NOOP', - payload: null, - }; + return noopAction('doubleCheckMissingQuoteReference'); } function setPendingRequestedAvatarDownload( diff --git a/ts/state/ducks/linkPreviews.preload.ts b/ts/state/ducks/linkPreviews.preload.ts index f761bc9516..e8936a772e 100644 --- a/ts/state/ducks/linkPreviews.preload.ts +++ b/ts/state/ducks/linkPreviews.preload.ts @@ -11,7 +11,7 @@ import type { } from '../../types/message/LinkPreviews.std.ts'; import type { AttachmentForUIType } from '../../types/Attachment.std.ts'; import type { MaybeGrabLinkPreviewOptionsType } from '../../types/LinkPreview.std.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import type { StateType as RootStateType } from '../reducer.preload.ts'; import { LinkPreviewSourceType } from '../../types/LinkPreview.std.ts'; import { assignWithNoUnnecessaryAllocation } from '../../util/assignWithNoUnnecessaryAllocation.std.ts'; @@ -62,10 +62,7 @@ function debouncedMaybeGrabLinkPreview( return dispatch => { maybeGrabLinkPreview(message, source, options); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('debouncedMaybeGrabLinkPreview')); }; } diff --git a/ts/state/ducks/noop.std.ts b/ts/state/ducks/noop.std.ts index 9ed4ffe1f9..a8505838b3 100644 --- a/ts/state/ducks/noop.std.ts +++ b/ts/state/ducks/noop.std.ts @@ -4,13 +4,13 @@ import type { ReadonlyDeep } from 'type-fest'; export type NoopActionType = ReadonlyDeep<{ - type: 'NOOP'; + type: `NOOP/${string}`; payload: null; }>; -export function noopAction(): NoopActionType { +export function noopAction(cause: string): NoopActionType { return { - type: 'NOOP', + type: `NOOP/${cause}`, payload: null, }; } diff --git a/ts/state/ducks/stickers.preload.ts b/ts/state/ducks/stickers.preload.ts index 50091f9911..ddbd188433 100644 --- a/ts/state/ducks/stickers.preload.ts +++ b/ts/state/ducks/stickers.preload.ts @@ -24,7 +24,7 @@ import { trigger } from '../../shims/events.dom.ts'; import { ERASE_STORAGE_SERVICE } from './user.preload.ts'; import type { EraseStorageServiceStateAction } from './user.preload.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.ts'; import { useBoundActions } from '../../hooks/useBoundActions.std.ts'; import { strictAssert } from '../../util/assert.std.ts'; @@ -221,10 +221,7 @@ function downloadStickerPack( }) ); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('downloadStickerPack'); } function installStickerPack( diff --git a/ts/state/ducks/stories.preload.ts b/ts/state/ducks/stories.preload.ts index e639e0e979..f434336dae 100644 --- a/ts/state/ducks/stories.preload.ts +++ b/ts/state/ducks/stories.preload.ts @@ -15,7 +15,7 @@ import type { MessagesAddedActionType, TargetedConversationChangedActionType, } from './conversations.preload.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import type { StateType as RootStateType } from '../reducer.preload.ts'; import type { StoryViewTargetType, @@ -320,10 +320,7 @@ function deleteGroupStoryReplyForEveryone( // the call above re-uses the sync-message processing code to update the UI // we don't need to do anything here - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('deleteGroupStoryReplyForEveryone')); }; } @@ -555,10 +552,7 @@ function queueStoryDownload( return; } - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('queueStoryDownload')); }; } @@ -578,10 +572,7 @@ function reactToStory( emoji: nextReaction, remove: false, }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('reactToStory')); } catch (error) { log.error('Error enqueuing reaction', error, messageId, nextReaction); dispatch({ @@ -1455,10 +1446,7 @@ function removeAllContactStories( await DataWriter.removeMessagesById(messageIds, { cleanupMessages }); - dispatch({ - type: 'NOOP', - payload: null, - }); + dispatch(noopAction('removeAllContactStories')); }; } diff --git a/ts/state/ducks/toast.preload.ts b/ts/state/ducks/toast.preload.ts index e07b509fae..fbf7e1cc63 100644 --- a/ts/state/ducks/toast.preload.ts +++ b/ts/state/ducks/toast.preload.ts @@ -5,7 +5,7 @@ import { ipcRenderer } from 'electron'; import type { ReadonlyDeep } from 'type-fest'; import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions.std.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import { useBoundActions } from '../../hooks/useBoundActions.std.ts'; import type { AnyToast } from '../../types/Toast.dom.tsx'; @@ -48,10 +48,7 @@ function hideToast(toast?: AnyToast): HideToastActionType { function openFileInFolder(target: string): NoopActionType { ipcRenderer.send('show-item-in-folder', target); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('openFileInFolder'); } export type ShowToastAction = ReadonlyDeep<(toast: AnyToast) => void>; diff --git a/ts/state/ducks/user.preload.ts b/ts/state/ducks/user.preload.ts index 7b0467df15..0724e8a2ea 100644 --- a/ts/state/ducks/user.preload.ts +++ b/ts/state/ducks/user.preload.ts @@ -6,7 +6,7 @@ import { trigger } from '../../shims/events.dom.ts'; import type { LocaleMessagesType } from '../../types/I18N.std.ts'; import type { LocalizerType } from '../../types/Util.std.ts'; import type { MenuOptionsType } from '../../types/menu.std.ts'; -import type { NoopActionType } from './noop.std.ts'; +import { noopAction, type NoopActionType } from './noop.std.ts'; import type { AciString, PniString } from '../../types/ServiceId.std.ts'; import OS from '../../util/os/osMain.node.ts'; import { ThemeType } from '../../types/Util.std.ts'; @@ -106,10 +106,7 @@ function userChanged(attributes: { function manualReconnect(): NoopActionType { trigger('manualConnect'); - return { - type: 'NOOP', - payload: null, - }; + return noopAction('manualReconnect'); } const intlNotSetup = () => { diff --git a/ts/test-electron/state/ducks/calling_test.preload.ts b/ts/test-electron/state/ducks/calling_test.preload.ts index 7d7cb043eb..2177a680b0 100644 --- a/ts/test-electron/state/ducks/calling_test.preload.ts +++ b/ts/test-electron/state/ducks/calling_test.preload.ts @@ -210,7 +210,7 @@ describe('calling duck', () => { const ourAci = generateAci(); const getEmptyRootState = (): StateType => { - const rootState = rootReducer(undefined, noopAction()); + const rootState = rootReducer(undefined, noopAction('getEmptyRootState')); return { ...rootState, user: { diff --git a/ts/test-electron/state/ducks/conversations_test.preload.ts b/ts/test-electron/state/ducks/conversations_test.preload.ts index aea743005d..8d90b2c4c3 100644 --- a/ts/test-electron/state/ducks/conversations_test.preload.ts +++ b/ts/test-electron/state/ducks/conversations_test.preload.ts @@ -123,7 +123,8 @@ describe('both/state/ducks/conversations', () => { const SERVICE_ID_3 = generateAci(); const SERVICE_ID_4 = generateAci(); - const getEmptyRootState = () => rootReducer(undefined, noopAction()); + const getEmptyRootState = () => + rootReducer(undefined, noopAction('getEmptyRootState')); let sinonSandbox: sinon.SinonSandbox; let createGroupStub: sinon.SinonStub; diff --git a/ts/test-electron/state/ducks/stories_test.preload.ts b/ts/test-electron/state/ducks/stories_test.preload.ts index 42cb71d552..251a600053 100644 --- a/ts/test-electron/state/ducks/stories_test.preload.ts +++ b/ts/test-electron/state/ducks/stories_test.preload.ts @@ -47,7 +47,7 @@ describe('both/state/ducks/stories', () => { }); const getEmptyRootState = () => ({ - ...rootReducer(undefined, noopAction()), + ...rootReducer(undefined, noopAction('getEmptyRootState')), stories: getEmptyState(), }); diff --git a/ts/test-electron/state/ducks/username_test.preload.ts b/ts/test-electron/state/ducks/username_test.preload.ts index 8c18ce5c7a..c087776f9d 100644 --- a/ts/test-electron/state/ducks/username_test.preload.ts +++ b/ts/test-electron/state/ducks/username_test.preload.ts @@ -32,7 +32,7 @@ const DEFAULT_RESERVATION = { }; describe('electron/state/ducks/username', () => { - const emptyState = reducer(undefined, noopAction()); + const emptyState = reducer(undefined, noopAction('emptyState')); const stateWithReservation = { ...emptyState, username: { diff --git a/ts/test-electron/state/selectors/audioPlayer_test.preload.ts b/ts/test-electron/state/selectors/audioPlayer_test.preload.ts index 5928ce5f7f..3474925874 100644 --- a/ts/test-electron/state/selectors/audioPlayer_test.preload.ts +++ b/ts/test-electron/state/selectors/audioPlayer_test.preload.ts @@ -31,7 +31,7 @@ function voiceNoteDataForMessage( describe('state/selectors/audioPlayer', () => { const getEmptyRootState = (): StateType => { - return rootReducer(undefined, noopAction()); + return rootReducer(undefined, noopAction('getEmptyRootState')); }; describe('isPaused', () => { diff --git a/ts/test-electron/state/selectors/calling_test.preload.ts b/ts/test-electron/state/selectors/calling_test.preload.ts index 02f2441b48..1589c3539d 100644 --- a/ts/test-electron/state/selectors/calling_test.preload.ts +++ b/ts/test-electron/state/selectors/calling_test.preload.ts @@ -36,7 +36,7 @@ const ACI_1 = generateAci(); describe('state/selectors/calling', () => { const getEmptyRootState = () => { - const initial = rootReducer(undefined, noopAction()); + const initial = rootReducer(undefined, noopAction('getEmptyRootState')); return rootReducer( initial, userActions.userChanged({ diff --git a/ts/test-electron/state/selectors/conversations-extra_test.preload.ts b/ts/test-electron/state/selectors/conversations-extra_test.preload.ts index 0962b892ce..b504b0e061 100644 --- a/ts/test-electron/state/selectors/conversations-extra_test.preload.ts +++ b/ts/test-electron/state/selectors/conversations-extra_test.preload.ts @@ -29,7 +29,7 @@ describe('both/state/selectors/conversations-extra', () => { const GROUP_ID = Bytes.toBase64(new Uint8Array(ID_LENGTH)); const getEmptyRootState = (): StateType => { - return rootReducer(undefined, noopAction()); + return rootReducer(undefined, noopAction('getEmptyRootState')); }; function makeConversation( diff --git a/ts/test-node/state/ducks/audioPlayer_test.preload.ts b/ts/test-node/state/ducks/audioPlayer_test.preload.ts index c15c42e8ed..d85c1cfe40 100644 --- a/ts/test-node/state/ducks/audioPlayer_test.preload.ts +++ b/ts/test-node/state/ducks/audioPlayer_test.preload.ts @@ -44,7 +44,7 @@ function voiceNoteDataForMessage( describe('both/state/ducks/audioPlayer', () => { const getEmptyRootState = (): StateType => { - return rootReducer(undefined, noopAction()); + return rootReducer(undefined, noopAction('getEmptyRootState')); }; const getInitializedState = (): StateType => { diff --git a/ts/test-node/state/ducks/composer_test.preload.ts b/ts/test-node/state/ducks/composer_test.preload.ts index 6df27b1c71..d5587566aa 100644 --- a/ts/test-node/state/ducks/composer_test.preload.ts +++ b/ts/test-node/state/ducks/composer_test.preload.ts @@ -38,7 +38,7 @@ describe('both/state/ducks/composer', () => { }; function getRootStateFunction(conversationId?: string) { - const state = rootReducer(undefined, noopAction()); + const state = rootReducer(undefined, noopAction('getRootStateFunction')); return () => ({ ...state, nav: { diff --git a/ts/test-node/state/ducks/donations_test.preload.ts b/ts/test-node/state/ducks/donations_test.preload.ts index c56af0f57c..4d160fc584 100644 --- a/ts/test-node/state/ducks/donations_test.preload.ts +++ b/ts/test-node/state/ducks/donations_test.preload.ts @@ -16,7 +16,7 @@ import { generateAci } from '../../../types/ServiceId.std.ts'; describe('donations duck', () => { const getEmptyRootState = (): StateType => - rootReducer(undefined, noopAction()); + rootReducer(undefined, noopAction('getEmptyRootState')); const storageMap = new Map(); const storage = { diff --git a/ts/test-node/state/ducks/preferredReactions_test.preload.ts b/ts/test-node/state/ducks/preferredReactions_test.preload.ts index 5a88d7a83d..aea346c49f 100644 --- a/ts/test-node/state/ducks/preferredReactions_test.preload.ts +++ b/ts/test-node/state/ducks/preferredReactions_test.preload.ts @@ -18,7 +18,7 @@ import { itemStorage } from '../../../textsecure/Storage.preload.ts'; describe('preferred reactions duck', () => { const getEmptyRootState = (): StateType => - rootReducer(undefined, noopAction()); + rootReducer(undefined, noopAction('getEmptyRootState')); const getRootState = ( preferredReactions: PreferredReactionsStateType diff --git a/ts/test-node/state/selectors/conversations_test.preload.ts b/ts/test-node/state/selectors/conversations_test.preload.ts index 24f7adf5f8..37d0e15996 100644 --- a/ts/test-node/state/selectors/conversations_test.preload.ts +++ b/ts/test-node/state/selectors/conversations_test.preload.ts @@ -67,7 +67,7 @@ describe('both/state/selectors/conversations-extra', () => { const SERVICE_ID_2 = generateAci(); const getEmptyRootState = (): StateType => { - return rootReducer(undefined, noopAction()); + return rootReducer(undefined, noopAction('getEmptyRootState')); }; function makeConversation(id: string): ConversationType { diff --git a/ts/test-node/state/selectors/preferredReactions_test.preload.ts b/ts/test-node/state/selectors/preferredReactions_test.preload.ts index a419b19901..26326252a7 100644 --- a/ts/test-node/state/selectors/preferredReactions_test.preload.ts +++ b/ts/test-node/state/selectors/preferredReactions_test.preload.ts @@ -11,7 +11,7 @@ import { getIsCustomizingPreferredReactions } from '../../../state/selectors/pre describe('both/state/selectors/preferredReactions', () => { const getEmptyRootState = (): StateType => - rootReducer(undefined, noopAction()); + rootReducer(undefined, noopAction('getEmptyRootState')); const getRootState = (preferredReactions: PreferredReactionsStateType) => ({ ...getEmptyRootState(), diff --git a/ts/test-node/state/selectors/search_test.preload.ts b/ts/test-node/state/selectors/search_test.preload.ts index 8d7c34ba59..06876a8236 100644 --- a/ts/test-node/state/selectors/search_test.preload.ts +++ b/ts/test-node/state/selectors/search_test.preload.ts @@ -48,7 +48,7 @@ describe('both/state/selectors/search', () => { }); const getEmptyRootState = (): StateType => { - return rootReducer(undefined, noopAction()); + return rootReducer(undefined, noopAction('getEmptyRootState')); }; function getDefaultMessage(id: string): MessageType {