Skip to content

Commit

Permalink
Fix issue of duplicate CRSs being generated
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed Apr 18, 2024
1 parent ce027b2 commit 7b3df49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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 @@ -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()
Expand Down

0 comments on commit 7b3df49

Please sign in to comment.