diff --git a/packages/desktop/src/rtl-tests/channel.main.test.tsx b/packages/desktop/src/rtl-tests/channel.main.test.tsx index 09d6022f8a..57807bf058 100644 --- a/packages/desktop/src/rtl-tests/channel.main.test.tsx +++ b/packages/desktop/src/rtl-tests/channel.main.test.tsx @@ -754,6 +754,15 @@ describe('Channel', () => { nickname: 'alice', }) + initialState.dispatch( + communities.actions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) + ) + let cid = '' const uploadingDelay = 100 @@ -897,6 +906,15 @@ describe('Channel', () => { nickname: 'alice', }) + initialState.dispatch( + communities.actions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) + ) + const message = Math.random().toString(36).substr(2.9) const entities = initialState.getState().PublicChannels.channels.entities @@ -1021,11 +1039,20 @@ describe('Channel', () => { const community = await factory.create['payload']>('Community') - await factory.create['payload']>('Identity', { + const alice = await factory.create['payload']>('Identity', { id: community.id, nickname: 'alice', }) + initialState.dispatch( + communities.actions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) + ) + jest.spyOn(socket, 'emit').mockImplementation(async (...input: [SocketActionTypes, ...socketEventData<[any]>]) => { const action = input[0] if (action === SocketActionTypes.LAUNCH_COMMUNITY) { @@ -1122,6 +1149,15 @@ describe('Channel', () => { nickname: 'alice', }) + initialState.dispatch( + communities.actions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) + ) + const messageId = Math.random().toString(36).substr(2.9) const entities = initialState.getState().PublicChannels.channels.entities const generalId = Object.keys(entities).find(key => entities[key]?.name === 'general') @@ -1238,6 +1274,15 @@ describe('Channel', () => { nickname: 'alice', }) + initialState.dispatch( + communities.actions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) + ) + const messageId = Math.random().toString(36).substr(2.9) const entities = initialState.getState().PublicChannels.channels.entities const generalId = Object.keys(entities).find(key => entities[key]?.name === 'general') @@ -1356,6 +1401,15 @@ describe('Channel', () => { nickname: 'alice', }) + initialState.dispatch( + communities.actions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) + ) + const messageId = Math.random().toString(36).substr(2.9) const entities = initialState.getState().PublicChannels.channels.entities const generalId = Object.keys(entities).find(key => entities[key]?.name === 'general') diff --git a/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.test.ts b/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.test.ts index 36a35012a7..b9436f8bfd 100644 --- a/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.test.ts +++ b/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.test.ts @@ -54,14 +54,12 @@ describe('verifyMessage saga test', () => { aliceCsr = alice.userCsr?.userCsr || '' store.dispatch( - communitiesActions.updateCommunityData( - { - id: community.id, - // null/undefined type mismatch here. Might make things easier - // to make it consistent. - ownerCertificate: alice.userCertificate || undefined, - } - ) + communitiesActions.updateCommunityData({ + id: community.id, + // null/undefined type mismatch here. Might make things easier + // to make it consistent. + ownerCertificate: alice.userCertificate || undefined, + }) ) bob = await factory.create['payload']>('Identity', { diff --git a/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.ts b/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.ts index c7b767f028..f4d79183d2 100644 --- a/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.ts +++ b/packages/state-manager/src/sagas/messages/verifyMessage/verifyMessages.saga.ts @@ -19,6 +19,7 @@ export function* verifyMessagesSaga( if (ownerData?.pubKey) { break } + console.warn('Owner certificate missing!') yield* delay(500) }