-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
Currently the EnvironmentResponse class contained a boolean initialized field and a string error_message field, the combination of whic is used to determine what action is taken during WorkerDispatcher initialization. At the moment this decision is spread across multiple lines and is not immediately clear on what the acceptable/valid states are without detailed knowledge of the class. The correct interpretation should be as follows:
initialized=True |
initialized=False |
|
|---|---|---|
error_message is None |
Return | Block until next poll |
error_message is not None |
Undefined | Raise |
This should be encapsulated in e.g. a dedicated enum field so that he logic is fixed and can be interpreted based on an explicit set of possibilities
Acceptance Criteria
- The
EnvironmentResponseclass contains a single field that encapsulates the interpretation logic described as known states which can be directly compared - The new field is updated automatically by the class when the state of its constituent parts changes
- The affected interpretations of the class have been migrated to use the new field
- Tests have been provided to validate the behaviour for eaxh allowed state of the field
Reactions are currently unavailable