Yowsup development, debugging, maintainance and sanity

Amal Murali edited this page Jan 28, 2016 · 6 revisions

Yowsup development, maintenance and sanity

Previously the project maintenance was a joke. There was no guidelines, roadmaps or unit tests. This resulted in the issues piling up in the issue tracker, lots of ignored pull requests and other problems. With the project now getting bigger, more people using it, and WhatsApp pouring in new features, the project maintenance must be taken seriously.

Unit tests

Yowsup now has unit tests. I'd appreciate it very much if you could sends tests along with your code. If not, then please bear in mind - it will take me time to implement those tests, which in turn delays merging in your code.

Demos

Feel free to send more demos to include in yowsup-cli

Some development guidelines

  • Yowsup supports Python 2.6+ and 3.0+, and it must remain that way.
  • Therefore, use print function, not the statement.
  • Use logging instead of print when appropriate.
  • Write clean, easy-to-read code.
  • Write unit tests whenever possible.

Debugging

yowsup-cli

yowsup-cli is your friend. Add in the --debug switch and you can see all sent and received stanza data

Deeper debugging

Because of the layer approach in which yowsup is architectured, you can throw in a YowLoggerLayer anywhere in your stack (see stacks and layers). If you want to check the bytes received from the network layer, put a YowLoggerLayer on top of it. If you want to see "sent" and "received" stanza bytes before and after encryption, throw one below YowCryptLayer and one above of it. Simple!