buglabs/bugswarm-tools — Issue #18: producer.py sends invalid json to BUGswarm in some cases
Author: aturley
Created: 2011-11-30 14:22:23+00:00
State: open

Summary:

Commit https://github.com/buglabs/bugswarm-tools/commit/ab42f1747ea7ad8dc02576e261d0a5625fb9b700 intentionally sends invalid json in several circumstances.

https://github.com/buglabs/bugswarm-tools/commit/ab42f1747ea7ad8dc02576e261d0a5625fb9b700#L0R36
This will produce the following json:
{"message": {"to": ["SWARM_ID"], "payload":}}
There is no value associated with the payload key. The same thing will happen here:
https://github.com/buglabs/bugswarm-tools/commit/ab42f1747ea7ad8dc02576e261d0a5625fb9b700#L0R47

The system seems to keep behaving as expected, so this doesn't seem to break anything right now. However, intentionally sending invalid json makes me nervous, especially if this tool is supposed to serve as a reference.

If we just need to send some garbage to initiate the connection, then we should send a small piece of garbage and note in a comment why we're doing it. If we can get away with sending something else as the payload(a bare newline or something like that) then maybe that's a cleaner option.