Currently posting and saving status to DB aren't atomic.
After a successful call to GH if DB update failed review will be duplicated.
Proposed solution:
If we create review without body attribute, it will be visible to an user only after the submit call.
It's safe to call submit multiple times.
Steps:
- Call create without body if it doesn't have ID of review in DB already
- Save returned ID to DB
- In case of failure, we can just retry later without any issues for an end user
- Send confirm (submit)
- Update status in DB
- In case of failure, we can just safely retry later
Currently posting and saving status to DB aren't atomic.
After a successful call to GH if DB update failed review will be duplicated.
Proposed solution:
If we create review without body attribute, it will be visible to an user only after the submit call.
It's safe to call submit multiple times.
Steps: