c4dt / d-voting

📧 E-Voting platform based on the Dela blockchain
https://dedis.github.io/d-voting
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Cannot add 5'000 scipers for an election #155

Closed dragonleman closed 4 months ago

dragonleman commented 5 months ago

When I add 5'000 scipers as voters, I get :

image

The election is created but I cannot do anything :

image

And I don't see anymore the button "Create form" (as I am not anymore an admin). But if I refresh the page, I can get back the button "Create form" ...

If I put my sciper number at the top of the list of the scipers number, I can vote even with the error message above. But if my sciper number is at the bottom of the list of the scipers number, I am not allowed to vote ...

[!NOTE] It seems I can add batches of 300 to 500 (max) sciper numbers. It would be useful to know how many sciper numbers have been added. The window of "Adding voters" keeps growing too much with a large number of scipers. A vertical scroll woulb be enough.

multiscan commented 5 months ago

Digging a bit further I saw that while adding the voters, the browser does one POST request per sciper number and the requests seams to fail randomly (see attached images). The error message is "Unauthorized - only admins allowed". In fact, what happens is that the when authorisation is checked, the authEnforcer is not ready yet. I think adding an await in front of line 7 of users.ts should fix the issue.

Screenshot 2024-04-11 at 10 38 42