Skip to content

Commit

Permalink
Merge branch 'develop' into feature/2310
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Mar 21, 2024
2 parents 9f84ffe + 799256f commit bc2430d
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 12 deletions.
6 changes: 6 additions & 0 deletions packages/backend/src/backendManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import initRnBridge from './rn-bridge'
import { INestApplicationContext } from '@nestjs/common'
import logger from './nest/common/logger'
import { OpenServices, validateOptions } from './options'
import { SOCKS_PROXY_AGENT } from './nest/const'

const log = logger('backendManager')

Expand Down Expand Up @@ -112,11 +113,16 @@ export const runBackendMobile = async () => {
const connectionsManager = app.get<ConnectionsManagerService>(ConnectionsManagerService)
connectionsManager.closeSocket()
})

rn_bridge.channel.on('open', async (msg: OpenServices) => {
const connectionsManager = app.get<ConnectionsManagerService>(ConnectionsManagerService)
const torControl = app.get<TorControl>(TorControl)
const proxyAgent = app.get<{ proxy: { port: string } }>(SOCKS_PROXY_AGENT)

torControl.torControlParams.port = msg.torControlPort
torControl.torControlParams.auth.value = msg.authCookie
proxyAgent.proxy.port = msg.httpTunnelPort

await connectionsManager.openSocket()
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/nest/storage/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export class StorageService extends EventEmitter {
)
const channel = this.channels.get(channelId)

this.logger(`Found existing channel: ${channel}`)
this.logger('Found existing channel:', channel)

if (channel === undefined) {
await this.channels.put(channelId, { ...channelData })
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.1.2-alpha.11",
"version": "2.1.2-alpha.12",
"description": "Decentralized team chat",
"main": "dist/main/main.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions packages/desktop/src/rtl-tests/community.join.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { AnyAction } from 'redux'
import {
InvitationData,
ChannelsReplicatedPayload,
ChannelSubscribedPayload,
Community,
ErrorPayload,
type NetworkInfo,
Expand Down Expand Up @@ -116,6 +117,9 @@ describe('User', () => {
},
},
})
socket.socketClient.emit<ChannelSubscribedPayload>(SocketActionTypes.CHANNEL_SUBSCRIBED, {
channelId: 'general',
})
}
}

Expand Down Expand Up @@ -185,6 +189,7 @@ describe('User', () => {
"Network/addInitializedCommunity",
"Communities/clearInvitationCodes",
"PublicChannels/channelsReplicated",
"PublicChannels/setChannelSubscribed",
"PublicChannels/addChannel",
"Messages/addPublicChannelsMessagesBase",
"PublicChannels/sendIntroductionMessage",
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ android {
applicationId "com.quietmobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 407
versionName "2.1.2-alpha.11"
versionCode 408
versionName "2.1.2-alpha.12"
resValue "string", "build_config_package", "com.quietmobile"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/ios/Quiet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>364</string>
<string>365</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false />
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/ios/QuietTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>364</string>
<string>365</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions packages/mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quiet/mobile",
"version": "2.1.2-alpha.11",
"version": "2.1.2-alpha.12",
"scripts": {
"build": "tsc -p tsconfig.build.json --noEmit",
"storybook-android": "ENVFILE=.env.storybook react-native run-android --mode=storybookDebug --appIdSuffix=storybook.debug",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { put, select, call } from 'typed-redux-saga'
import { put, select, call, delay } from 'typed-redux-saga'
import { messagesActions } from '../../messages/messages.slice'
import { publicChannelsSelectors } from '../publicChannels.selectors'
import { WriteMessagePayload, MessageType, PublicChannel, PublicChannelStorage } from '@quiet/types'
Expand All @@ -24,6 +24,24 @@ 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 }))
}

0 comments on commit bc2430d

Please sign in to comment.