Skip to content

Commit

Permalink
Fix(2321): No Duplicate CSRs (#2460)
Browse files Browse the repository at this point in the history
* Fix issue of duplicate CRSs being generated

* Install LFS with checkout to avoid random errors
  • Loading branch information
ikoenigsknecht authored and leblowl committed Apr 29, 2024
1 parent d185fdf commit 042ad63
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:

steps:
- uses: actions/checkout@v4

with:
lfs: true

- uses: actions/setup-node@master
with:
node-version: 18.12.1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:

steps:
- uses: actions/checkout@v4

with:
lfs: true

- uses: actions/setup-node@master
with:
node-version: 18.12.1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Chores

* Cleanup data directory at end of e2e tests
* Don't create duplicate CSRs when joining a community under certain circumstances ([#2321](https://github.com/TryQuiet/quiet/issues/2321))

[2.2.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
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 @@ -313,7 +313,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()
Expand Down

0 comments on commit 042ad63

Please sign in to comment.