Open Marchand-Nicolas opened 5 hours ago
can I work on this @Marchand-Nicolas? I'm a frontend and smart contract developer. To fix this bug, I will replace the addedTasks.map with a for...of loop to ensure that each request is awaited before moving to the next one. This approach ensures that each task is processed sequentially, preventing simultaneous ID assignments. The for...of loop combined with await will wait for each request to resolve before continuing to the next one. ETA: 24hrs.
Hi @Iwueseiter! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.
Hi @Iwueseiter! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.
Description
Fix: we often create new tasks in a batch. This is currently a problem because as the backend receives all these requests, it assigns the tasks IDs simultaneously, which causes multiples tasks to have the same ID (where every ID should be unique, and should, when adding a new task, be the last task ID + 1).
PROPOSED TODO
The issue is located here:
app\admin\quests\dashboard\[questId]\page.tsx
addedTasks.map
(which doesn't wait for the current request to get answered before doing the next one), we should use a for loop. That way, each request will be processed separately, preventing simultaneous ID assignment.