From 0966478d056f9d3149ebd05f9013cc94683ca7d9 Mon Sep 17 00:00:00 2001 From: Isla Koenigsknecht Date: Thu, 18 Apr 2024 17:59:00 -0400 Subject: [PATCH] Fix(2321): No Duplicate CSRs (#2460) * Fix issue of duplicate CRSs being generated * Install LFS with checkout to avoid random errors --- .github/workflows/e2e-android.yml | 7 ++----- .github/workflows/e2e-ios.yml | 7 ++----- CHANGELOG.md | 2 ++ .../certifacteRequests/certificatesRequestsStore.ts | 1 + packages/backend/src/nest/storage/storage.service.ts | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e-android.yml b/.github/workflows/e2e-android.yml index 4481bdc54d..60ad8b4502 100644 --- a/.github/workflows/e2e-android.yml +++ b/.github/workflows/e2e-android.yml @@ -15,17 +15,14 @@ jobs: steps: - uses: actions/checkout@v4 + with: + lfs: true - name: Install dependencies run: | npm i npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle - - name: Pull binaries - run: | - git lfs install - git lfs pull - - name: Pass local config run : | cat << EOF >> packages/mobile/android/local.properties diff --git a/.github/workflows/e2e-ios.yml b/.github/workflows/e2e-ios.yml index 34ad277d79..77a89d425b 100644 --- a/.github/workflows/e2e-ios.yml +++ b/.github/workflows/e2e-ios.yml @@ -14,17 +14,14 @@ jobs: steps: - uses: actions/checkout@v4 + with: + lfs: true - name: Install dependencies run: | npm i npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle - - name: Pull binaries - run: | - git lfs install - git lfs pull - - name: Install pods run: | cd packages/mobile/ios diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ad80e5c2..dcc0e8492c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ # Fixes: +* Don't create duplicate CSRs when joining a community under certain circumstances ([#2321](https://github.com/TryQuiet/quiet/issues/2321)) + [2.2.0] # New features: diff --git a/packages/backend/src/nest/storage/certifacteRequests/certificatesRequestsStore.ts b/packages/backend/src/nest/storage/certifacteRequests/certificatesRequestsStore.ts index 5c30871d59..ce32cbe387 100644 --- a/packages/backend/src/nest/storage/certifacteRequests/certificatesRequestsStore.ts +++ b/packages/backend/src/nest/storage/certifacteRequests/certificatesRequestsStore.ts @@ -29,6 +29,7 @@ export class CertificatesRequestsStore extends EventEmitter { write: ['*'], }, }) + await this.store.load() this.store.events.on('write', async (_address, entry) => { this.logger('Added CSR to database') diff --git a/packages/backend/src/nest/storage/storage.service.ts b/packages/backend/src/nest/storage/storage.service.ts index 1d9ba7eafe..5f353a3119 100644 --- a/packages/backend/src/nest/storage/storage.service.ts +++ b/packages/backend/src/nest/storage/storage.service.ts @@ -314,7 +314,7 @@ export class StorageService extends EventEmitter { public async updatePeersList() { const users = this.getAllUsers() - const peers = users.map(peer => createLibp2pAddress(peer.onionAddress, peer.peerId)) + const peers = Array.from(new Set(users.map(peer => createLibp2pAddress(peer.onionAddress, peer.peerId)))) console.log('updatePeersList, peers count:', peers.length) const community = await this.localDbService.getCurrentCommunity()