Spec points
- RSL1e: "If any of the values are null, then key is not sent to Ably."
- RTL6i3: Same requirement — a payload with null `data` should be sent as `{ "name": "click" }`, omitting the `data` key entirely.
Observed behaviour
When `data` is `null`/`undefined`, ably-js includes it as `"data": null` in the JSON wire format instead of omitting the key. Same for `name`.
Message serialization in `src/common/lib/types/message.ts` does not strip null/undefined values before `JSON.stringify`.
Failing tests (2)
| Test |
Expected |
Actual |
| `RSL1e - null name omitted from body` |
Body has no `name` key |
Body has `"name": null` |
| `RSL1e - null data omitted from body` |
Body has no `data` key |
Body has `"data": null` |
Reproduction
```bash
RUN_DEVIATIONS=1 npx mocha --grep "RSL1e - null" test/uts/rest/channel/publish.test.ts
```
From PR #2191, branch `uts-rest`.
┆Issue is synchronized with this Jira Task by Unito
Spec points
Observed behaviour
When `data` is `null`/`undefined`, ably-js includes it as `"data": null` in the JSON wire format instead of omitting the key. Same for `name`.
Message serialization in `src/common/lib/types/message.ts` does not strip null/undefined values before `JSON.stringify`.
Failing tests (2)
Reproduction
```bash
RUN_DEVIATIONS=1 npx mocha --grep "RSL1e - null" test/uts/rest/channel/publish.test.ts
```
From PR #2191, branch `uts-rest`.
┆Issue is synchronized with this Jira Task by Unito