Skip to content

Commit c7488cd

Browse files
authored
Feat/2805 Log Entry Fanout Ingestion (#3041)
* ingest entries from qss fanout * ingest entry correctly and prevent sending multiple messages for the same entry * setup just one listener * add e2e test * fix backend unit tests * fix state manager tests * update changelog * add waits in oneclient to allow app to fully open * update submodule pointer * add delay in test * add additional tor init interval logging to debug multiple clients test fail * make sure starting panel doesn't occlude after startup * replace startPanel waitForLoadingToComplete with more suitable test for DOM removal * avoid crashing renderer if watch is still active * close join community modal when custom protocol finishes * wait for starting panel to be either invisible OR not in the DOM * fix some crashes and e2e test weirdest * fix hangups * fix back compat test * make address required * allow only one attempts for quicker feedback * better type safety and address selection for dialing and invites * extend ping intervals and timeouts * bring back normal attempt limit
1 parent 9f9763e commit c7488cd

File tree

33 files changed

+612
-155
lines changed

33 files changed

+612
-155
lines changed

.github/workflows/e2e-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ jobs:
9292
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
9393
with:
9494
timeout_minutes: 25
95-
max_attempts: 1
95+
max_attempts: 3
9696
command: cd packages/e2e-tests && npm run test invitationLink.test.ts

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* Adds hcaptcha verification for protected QSS actions [#2908](https://github.com/TryQuiet/quiet/issues/2908)
88
* Add ability to adjust image/file auto-download size threshold [#3019](https://github.com/TryQuiet/quiet/pull/3019)
9+
* Messages can now be relayed using QSS [#2805](https://github.com/TryQuiet/quiet/issues/2805)
910

1011
### Fixes
1112

packages/backend/src/nest/connections-manager/connections-manager.service.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {
5252
SetUserProfileResponse,
5353
} from '@quiet/types'
5454
import { CONFIG_OPTIONS, QSS_ALLOWED, QSS_ENDPOINT, SERVER_IO_PROVIDER, SOCKS_PROXY_AGENT } from '../const'
55-
import { Libp2pService } from '../libp2p/libp2p.service'
55+
import { Libp2pService, Libp2pState } from '../libp2p/libp2p.service'
5656
import { CreatedLibp2pPeerId, Libp2pEvents, Libp2pNodeParams, Libp2pPeerInfo } from '../libp2p/libp2p.types'
5757
import { LocalDbService } from '../local-db/local-db.service'
5858
import { LocalDBKeys } from '../local-db/local-db.types'
@@ -250,8 +250,7 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
250250
this.logger.info('Pausing!')
251251
await this.closeSocket()
252252
this.logger.info('Pausing libp2pService!')
253-
this.peerInfo = await this.libp2pService?.pause()
254-
this.logger.info('Found the following peer info on pause: ', this.peerInfo)
253+
await this.libp2pService?.pause()
255254
}
256255

257256
public async resume() {
@@ -794,6 +793,26 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
794793
callback(await this.storageService?.addUserProfile(payload.profile))
795794
}
796795
)
796+
797+
this.socketService.on(SocketActions.TOGGLE_P2P, async (payload: boolean, callback: (response: boolean) => void) => {
798+
try {
799+
if (payload) {
800+
await this.libp2pService.resume()
801+
await this.storageService.startSync()
802+
} else {
803+
await this.libp2pService.pause()
804+
await this.storageService.stopSync()
805+
}
806+
} catch (e) {
807+
this.logger.error('Error toggling libp2p service', e)
808+
}
809+
810+
if (this.libp2pService.state === Libp2pState.Started) {
811+
callback(true)
812+
} else {
813+
callback(false)
814+
}
815+
})
797816
}
798817

799818
/**

packages/backend/src/nest/libp2p/libp2p.auth.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,10 @@ export class Libp2pAuth {
426426
return
427427
}
428428

429+
let id: string
429430
try {
430431
this.sigChainService.getActiveChain()
431-
this.sigChainService.team
432+
id = this.sigChainService.team.id
432433
} catch (e) {
433434
this.joinStatus = JoinStatus.NOT_STARTED
434435
return
@@ -440,7 +441,7 @@ export class Libp2pAuth {
440441
* information in their chain yet resulting in an invalid device error)
441442
*/
442443
const oldJoinStatus = this.joinStatus
443-
if (this.joinedViaQSS(this.sigChainService.team.id)) {
444+
if (this.joinedViaQSS(id)) {
444445
this.joinStatus = JoinStatus.PENDING_MEMBER
445446
} else {
446447
this.joinStatus = JoinStatus.PENDING

0 commit comments

Comments
 (0)