Currently if the user attempts to start recording a data file, but the file creation fails for some reason, the GUI is still updated as if it was successful (e.g. the RecordingWidget shows "RECORDING IN PROGRESS").
The problem is caused by the fact that there is only one pubsub message to request that recording starts ("data_file.open"), but there is no way for the frontend to know whether or not this was successful (it is implied to have failed if a "data_file.error" message is sent, but it would be finicky to make use of this information). A better approach is to do what we do for Devices and have a separate message when opening is successful, at which point the GUI can update itself. Implement this with a new "data_file.opened" message.
Fixes #561.
Type of change
[ ] New feature (non-breaking change which adds functionality)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] Documentation (non-breaking change that adds or improves the documentation)
[ ] Optimisation (non-breaking, back-end change that speeds up the code)
Key checklist
[x] Pre-commit hooks run successfully (pre-commit run -a)
[x] All tests pass (pytest)
[ ] The documentation builds without warnings (mkdocs build -s)
[x] Check the GUI still works (if relevant)
[ ] Check the code works with actual hardware (if relevant)
[ ] Check the pyinstaller-built executable works (if relevant)
Further checks
[x] Code is commented, particularly in hard-to-understand areas
[x] Tests have been added or an issue has been opened to tackle that in the future. (Indicate issue here: # (issue))
Description
Currently if the user attempts to start recording a data file, but the file creation fails for some reason, the GUI is still updated as if it was successful (e.g. the
RecordingWidget
shows "RECORDING IN PROGRESS").The problem is caused by the fact that there is only one pubsub message to request that recording starts (
"data_file.open"
), but there is no way for the frontend to know whether or not this was successful (it is implied to have failed if a"data_file.error"
message is sent, but it would be finicky to make use of this information). A better approach is to do what we do forDevice
s and have a separate message when opening is successful, at which point the GUI can update itself. Implement this with a new"data_file.opened"
message.Fixes #561.
Type of change
Key checklist
pre-commit run -a
)pytest
)mkdocs build -s
)pyinstaller
-built executable works (if relevant)Further checks