Spark/flash/status webhook events have trailing space in data property

While creating new integration webhooks for both spark/flash/status and spark/device/app-hash I noticed that there is a trailing white space in the data property of the spark/flash/status event. This makes it difficult to compare to strings in switch or if statements. The white space is only present in the spark/flash/status events.

Webhook Configuration for JSON

{
  "event": "{{{PARTICLE_EVENT_NAME}}}",
  "data": "{{{PARTICLE_EVENT_VALUE}}}",
  "coreid": "{{{PARTICLE_DEVICE_ID}}}",
  "published_at": "{{{PARTICLE_PUBLISHED_AT}}}",
  "userid": "{{{PRODUCT_USER_ID}}}",
  "fw_version": "{{{PRODUCT_VERSION}}}",
  "public": "{{{PARTICLE_EVENT_PUBLIC}}}"
}

Log event directly copied from particle integration page

{
  "name": "spark/flash/status",
  "data": "success ",
  "ttl": 60,
  "published_at": "2024-05-10T19:31:14.315Z",
  "coreid": "e00fce684cc9c44639a5a565",
  "userid": "",
  "version": 503,
  "public": false,
  "productID": 22336
}

It's a reasonable request to remove the trailing space. However, it's been there forever, and removing it would break anyone who is depending on the space being there. So my guess is that it will not be removed, because between the option of being annoying (it is) and breaking something that is currently works, being annoying will probably be the chosen option.

It very much depends on the way you write your statements.
I'd also be curious how you do a switch statement with strings.

So event.data.trim() === "success" wouldn't work?

BTW, since you didn't mention JS I assumed C++ - my bad :blush:
However, no need to get :salt:y