Skip to content

Commit

Permalink
docs: add handleCsrReplicationEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacper-RF committed Nov 8, 2023
1 parent 97134c5 commit 1c14327
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Title:

## Status:
(accepted | rejected | proposed | deprecated)

## Context:
(what is our problem)

## Decision:
(how it will affect app or individual parts of the app)

## Consequences:
(how it will affect app or individual parts of the app)

## Code location:
(package->file)

## Date:
(dd.mm.rrrr)
20 changes: 20 additions & 0 deletions docs/handleCsrReplicationEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Title:
Handle possibility of multiple replication events in certificate requests at the same time

## Status:
accepted

## Context:
Kinga discovered a bug where when the owner is offline and several (3) users with the same name have joined, sometimes the owner can register two users with the same name

## Decision:
Introducing a locking mechanism to prevent the next event from being processed if the previous one is still being processed

## Consequences:
We added queue concept and events will be processed individually in chronological order

## Code location:
backend -> storage.service.ts

## Date:
07-11-2023
1 change: 1 addition & 0 deletions packages/backend/src/nest/storage/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ export class StorageService extends EventEmitter {
},
})

// DOCS -> handleCsrReplicationEvent.md
this.certificatesRequests.events.on('replicated', async () => {
this.logger('REPLICATED: CSRs')

Expand Down

0 comments on commit 1c14327

Please sign in to comment.