Closed jarhodes314 closed 10 months ago
Double quotes in failure reason must be escaped by two double quotes like below.
502,c8y_UploadConfigFile,"contains""double""quote"
This sanitize function escapes double quotes by two double quotes, so maybe our failure reason generation doesn't use this function? https://github.com/thin-edge/thin-edge.io/blob/b2162397cfef4c73dd7d5b794fdd3adb6d55b604/crates/core/c8y_api/src/smartrest/message.rs#L37-L46
@gligorisaev I'm hoping the examples from the robot test changes in https://github.com/thin-edge/thin-edge.io/pull/2493/files are sufficient for you to understand what this change affects in tedge and to reproduce it.
QA has thoroughly checked the feature and here are the results:
Is your feature improvement request related to a problem? Please describe. In #2474, I modified the code to debug print some values in errors that later get turned into failure reasons for operations. I was surprised to discover that the mapper removes quotes from failure reasons when serialising them to SmartREST, so this didn't work as intended.
Describe the solution you'd like Quotes in the error message should be preserved when they are sent to Cumulocity.
Describe alternatives you've considered
Additional context