Skip to content

Commit

Permalink
[doc] explain why we add sendVoters async function
Browse files Browse the repository at this point in the history
  • Loading branch information
multiscan committed Apr 17, 2024
1 parent 8dfd2fc commit b9060ec
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ const useChangeAction = (
return authorization.has(subject) && authorization.get(subject).indexOf(action) !== -1;
}

// requests to ENDPOINT_ADD_ROLE cannot be done in parallel because on the
// backend, auths are reloaded from the DB each time there is an update.
// While auths are reloaded, they cannot be checked in a predictable way.
// See isAuthorized, addPolicy, and addListPolicy in backend/src/authManager.ts
async function sendVoters(providedScipers, formID) {
const chunkSize = 1000;
for (let i = 0; i < providedScipers.length; i += chunkSize) {
Expand Down

0 comments on commit b9060ec

Please sign in to comment.