diff --git a/packages/desktop/package-lock.json b/packages/desktop/package-lock.json index c9e049edb0..8c5ca79ed2 100644 --- a/packages/desktop/package-lock.json +++ b/packages/desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "@quiet/desktop", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@quiet/desktop", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "license": "GPL-3.0-or-later", "dependencies": { "@electron/remote": "^2.0.8", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index f8bb9b22ca..303b5cbb7b 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -80,7 +80,7 @@ }, "homepage": "https://github.com/TryQuiet", "@comment version": "To build new version for specific platform, just replace platform in version tag to one of following linux, mac, windows", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "description": "Decentralized team chat", "main": "dist/main/main.js", "scripts": { diff --git a/packages/mobile/android/app/build.gradle b/packages/mobile/android/app/build.gradle index d74a8bbe60..6449017724 100644 --- a/packages/mobile/android/app/build.gradle +++ b/packages/mobile/android/app/build.gradle @@ -192,8 +192,8 @@ android { applicationId "com.quietmobile" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 413 - versionName "2.2.0-alpha.1" + versionCode 414 + versionName "2.2.0-alpha.2" resValue "string", "build_config_package", "com.quietmobile" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/packages/mobile/ios/Quiet/Info.plist b/packages/mobile/ios/Quiet/Info.plist index 01a2cc8c61..51846dee44 100644 --- a/packages/mobile/ios/Quiet/Info.plist +++ b/packages/mobile/ios/Quiet/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 370 + 371 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/packages/mobile/ios/QuietTests/Info.plist b/packages/mobile/ios/QuietTests/Info.plist index 167b0126a2..d450792c6a 100644 --- a/packages/mobile/ios/QuietTests/Info.plist +++ b/packages/mobile/ios/QuietTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 370 + 371 diff --git a/packages/mobile/package-lock.json b/packages/mobile/package-lock.json index 5f0c2a9a1a..706228ed3c 100644 --- a/packages/mobile/package-lock.json +++ b/packages/mobile/package-lock.json @@ -1,12 +1,12 @@ { "name": "@quiet/mobile", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@quiet/mobile", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "dependencies": { "@peculiar/webcrypto": "^1.4.3", "@react-native-clipboard/clipboard": "^1.13.2", diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 3f052532e6..2d8395a009 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@quiet/mobile", - "version": "2.2.0-alpha.1", + "version": "2.2.0-alpha.2", "scripts": { "build": "tsc -p tsconfig.build.json --noEmit", "storybook-android": "ENVFILE=.env.storybook react-native run-android --mode=storybookDebug --appIdSuffix=storybook.debug", diff --git a/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts b/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts index 4622539f7f..ae91990777 100644 --- a/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts +++ b/packages/state-manager/src/sagas/identity/registerUsername/registerUsername.saga.ts @@ -5,6 +5,7 @@ import { identitySelectors } from '../identity.selectors' import { identityActions } from '../identity.slice' import { config } from '../../users/const/certFieldTypes' import { Socket } from '../../../types' +import { communitiesActions } from '../../communities/communities.slice' import { communitiesSelectors } from '../../communities/communities.selectors' import { CreateUserCsrPayload, RegisterCertificatePayload, Community } from '@quiet/types' @@ -16,7 +17,13 @@ export function* registerUsernameSaga( const { nickname, isUsernameTaken = false } = action.payload - const community = yield* select(communitiesSelectors.currentCommunity) + let community = yield* select(communitiesSelectors.currentCommunity) + + if (!community) { + yield* take(communitiesActions.addNewCommunity) + } + + community = yield* select(communitiesSelectors.currentCommunity) if (!community) { console.error('Could not register username, no community data') diff --git a/packages/state-manager/src/sagas/messages/sendMessage/sendMessage.saga.ts b/packages/state-manager/src/sagas/messages/sendMessage/sendMessage.saga.ts index 9bb7c39b45..1297c1ea5b 100644 --- a/packages/state-manager/src/sagas/messages/sendMessage/sendMessage.saga.ts +++ b/packages/state-manager/src/sagas/messages/sendMessage/sendMessage.saga.ts @@ -1,7 +1,7 @@ import { type Socket, applyEmitParams } from '../../../types' import { type PayloadAction } from '@reduxjs/toolkit' import { sign, loadPrivateKey, pubKeyFromCsr } from '@quiet/identity' -import { call, select, apply, put } from 'typed-redux-saga' +import { call, select, apply, put, delay } from 'typed-redux-saga' import { arrayBufferToString } from 'pvutils' import { config } from '../../users/const/certFieldTypes' import { identitySelectors } from '../../identity/identity.selectors' @@ -75,6 +75,20 @@ export function* sendMessageSaga( const isUploadingFileMessage = action.payload.media?.cid?.includes('uploading') if (isUploadingFileMessage) return // Do not broadcast message until file is uploaded + // Wait until we have subscribed to the channel + // + // TODO: I think we probably want to revise how we are sending + // messages by having the backend handling queueing and retrying + // (in a durable way). + while (true) { + const subscribedChannels = yield* select(publicChannelsSelectors.subscribedChannels) + if (subscribedChannels.includes(channelId)) { + break + } + console.error('Failed to send message, channel not subscribed. Retrying...') + yield* delay(500) + } + yield* apply( socket, socket.emit, diff --git a/packages/state-manager/src/sagas/publicChannels/sendIntroductionMessage/sendIntroductionMessage.saga.ts b/packages/state-manager/src/sagas/publicChannels/sendIntroductionMessage/sendIntroductionMessage.saga.ts index 87e2cd04f4..8a485494b4 100644 --- a/packages/state-manager/src/sagas/publicChannels/sendIntroductionMessage/sendIntroductionMessage.saga.ts +++ b/packages/state-manager/src/sagas/publicChannels/sendIntroductionMessage/sendIntroductionMessage.saga.ts @@ -1,4 +1,4 @@ -import { put, select, call, delay } from 'typed-redux-saga' +import { put, select, call } from 'typed-redux-saga' import { messagesActions } from '../../messages/messages.slice' import { publicChannelsSelectors } from '../publicChannels.selectors' import { WriteMessagePayload, MessageType, PublicChannel, PublicChannelStorage } from '@quiet/types' @@ -24,24 +24,6 @@ export function* sendIntroductionMessageSaga(): Generator { channelId: generalChannel.id, } - // FIXME: This is a quick fix for an issue that can be fixed by - // unifying CHANNELS_STORED and CHANNELS_SUBSCRIBED events and - // refactoring a bit. The problem is that the frontend sends a - // message upon receiving the CHANNELS_STORED event, but the channel - // hasn't been fully initialized/subscribed yet (it doesn't exist in - // publicChannelsRepos on the backend so the backend fails to send - // it). Ideally, I think we should only tell the frontend about - // channels once they've been fully initialized. Once we fix that, - // we can remove the following code. - while (true) { - const subscribedChannels = yield* select(publicChannelsSelectors.subscribedChannels) - if (subscribedChannels.includes(generalChannel.id)) { - break - } - console.error('Failed to send introduction message, general channel not subscribed. Retrying...') - yield* delay(500) - } - yield* put(messagesActions.sendMessage(payload)) yield* put(identityActions.updateIdentity({ ...identity, introMessageSent: true })) }