indico / indico/newdle

"Race condition" between opening a newdle, people responding and updating its participants

Open
#486 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
118
Forks
76
PR merge metrics
No merged PRs in 30d

Description

According to a ticket we just got, there's most likely a bug where a participant can be silently lost:

1. Creator keeps their newdle (summary page) open in the browser
2. Someone who is not yet a participant responds to the newdle -> new participant is created
3. Creator edits the newdle's participants (e.g. removing or adding someone)

Most likely any participant that was created between step 1 and 3 is removed by [this code](https://github.com/indico/newdle/blob/master/newdle/api.py#L379-L392).

The best solution would probably be to not actually remove participants from the list when sending the PATCH request but rather setting something like `deleted: true`, and then only removing participants for which we received that data in the PATCH, and ignoring any participant that's simply not in the list.

Note: I have not tried to reproduce the issue, but it's the only logical explanation and the server logs for the newdle from the ticket don't contradict this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in newdle/api.py around lines 379-392 and inspect how the PATCH request updates the participant list. Try to reproduce the reported sequence, or add coverage for a participant created between opening the summary and submitting the edit. Done means such a participant is not silently removed when the creator updates participants.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.