Skip to main content

Module verify

Expand description

The verify phase: asking the study registry what became of a submission.

The only way out of submission_uncertain, and never a way back to import. Nothing here ever fails a row: the attainment may exist, and a failed row is one an admin retries, which for an uncertain submission would mean sending it twice.

Structsยง

Poll ๐Ÿ”’
One claimed row and the poll it was claimed for. The attempt count travels with it because it names the request item and sets the backoff the answer is scheduled by.
Recovery ๐Ÿ”’
A row whose submission we lost track of: nothing to poll by, so the lookup goes through resolve-enrolments instead.
UncertainRecovery ๐Ÿ”’
Looks for the attainment a submission we lost track of would have produced. The row stays submission_uncertain unless it is found: never failed, never re-imported.
VerifyPoll ๐Ÿ”’
Polls the rows that have something to poll by.

Constantsยง

CLAIMED_STATES ๐Ÿ”’
Both states the poller owns. Withdrawal moves a row out of both, which is what stops the polling without any query having to know about withdrawal.

Functionsยง

add ๐Ÿ”’
Sums what the two flows of one iteration did; the first error stands for the iteration.
apply_poll_answer ๐Ÿ”’
Applies one pollโ€™s answer. Everything but registered keeps the row where it is: notRegistered is a normal polling answer, and any other answer is one we will not act on blindly.
apply_recovery_answer ๐Ÿ”’
run