Closed jonathanperret closed 1 month ago
The changes made to the setUp
method of the Tester
class involve the addition of a conditional check for the FW_VERSION_SUFFIX
variable. This ensures that the suffix is included in the message only if it is not empty, replacing the previous implementation that sent it unconditionally. This adjustment improves the clarity of the messages generated by the method.
Files | Change Summary |
---|---|
src/ayab/tester.cpp | Added a conditional check for FW_VERSION_SUFFIX in the setUp method to prevent sending an empty string. |
sequenceDiagram
participant Tester
participant Message
Tester->>Message: Prepare message
alt FW_VERSION_SUFFIX is not empty
Tester->>Message: Append FW_VERSION_SUFFIX
end
Tester->>Message: Send message
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
The desktop app currently crashes when handling a testRes message with an empty string (see https://github.com/AllYarnsAreBeautiful/ayab-desktop/issues/701).
That bug should be fixed over there, but it turns out there's a bug in the firmware as well (that I introduced in https://github.com/AllYarnsAreBeautiful/ayab-firmware/pull/195), in that the suffix is not prefixed by a
-
as it should be.Adding this prefix, and making sure we don't send anything if there is no suffix, fixes that and "accidentally" works around the desktop bug.
How to test
ayab-desktop
and open the Hardware test dialog (without this PR, the dialog fails to open).ayab-desktop
and open the Hardware test dialog.1.2.3beta456
).Summary by CodeRabbit
FW_VERSION_SUFFIX
in the output, ensuring that only non-empty values are sent.