Describe the bug
The router may consider a study as completed even if there are incoming series for that study.
The router checks the study.last_receive_time to determine whether it reached the timeout and consider it completed. However, study.last_receive_timeis only updated once a series is completed. Thus, you could have a large series incoming for a given study and the route_studies method may eventually consider the study as completed since the router doesn't take into account uncompleted series. That forces to define high timeout values, since is complicated to predict the maximum time needed to receive a series.
To Reproduce
Define a short study timeout, e.g. 20s.
Define a rule that triggers on study completed
Send a study with 2 series minimum, and one of them needs to be large (or simulate a slow connection)
Router will trigger the rule before both series are received.
Expected behavior
A study should be considered completed when its series are marked as completed.
Describe the bug The router may consider a study as completed even if there are incoming series for that study. The router checks the
study.last_receive_time
to determine whether it reached the timeout and consider it completed. However,study.last_receive_time
is only updated once a series is completed. Thus, you could have a large series incoming for a given study and theroute_studies
method may eventually consider the study as completed since the router doesn't take into account uncompleted series. That forces to define high timeout values, since is complicated to predict the maximum time needed to receive a series.To Reproduce
Expected behavior A study should be considered completed when its series are marked as completed.