This change added a version flag to chunk header
``ChunkHeader()`` no longer works! You now have to do
``ChunkHeader(version = '0.6')`` or ``ChunkHeader(version = '0.7')``
This fixes 0.6 chunk header packing.
It has a suddle difference to 0.7 and it is now packed correctly.
Also unpacking 0.6.5 chunk headers is fixed by reading the correct size.
this forces setting the version on packet construction
and avoids unexpected version missmatches when updating the version
after the packet header has already been created.
To send a 0.6 packet one has to do the following:
packet = TwPacket(version = '0.6')
And it will guranteed to be a correct header and flags object
by default.
The recommended way now is setting the version when constructing the
packet. Like this:
packet = TwPacket(version = '0.6')
which will then set the correct header object in version 6 or 7
and thus also set the correct flags. And the version field is also set.
It is not recommended to do this:
packet = TwPacket() # defaults to 0.7
packet.version = '0.6'
That might cause confusion. This should be made more failsafe in a new
commit.
at some point libtw2 huffman should be tested in the ci too
and it should be possible for a user and a test case
to chose which huffman backend to run even if both are installed.
Maybe with a environment variable.
This commit is not about snapshots!
Generated the snap item classes for 0.6 and 0.7
And changed the type used for snap items from int to the snap class
This now allows to properly serialize and deserialize
messages such as sys.input
If it is not a user facing feature. Or something boring.
Do not name it fix or feat do name it chore instead.
A example would be changing configs like this commit.
Maybe even some internal variable naming convetion and so on.
This sets message fields to `None` if they were not set.
And also does not pack fields that are set to `None`
BREAKING CHANGE: earlier to this commit the control close reason field
was set to an empty string if it was not set. Now it is set to None