GSOC Day 15 – Orders Make Some Progress
After speaking with Mithro last night, I was able to fix some of the problems with the orders panel. I replaced the code that I had been stuck on successfully, eventually getting the order to be sent properly to the server after some fiddling.
However, the code had more problems in store for me. When the client tried to receive the new order to add it to its list, it crashed. The bug was deep in the libtpproto-py code, which is rather rare – usually it’s been fully fixed already. In this case, however, the libtpproto-py code was calling a constructor with the wrong arguments (likely code that had been skipped when updating libtpproto-py).
After fixing that, another error appeared. Now I could receive orders that already existed, but adding an order would still give the following message:
Traceback (most recent call last):
File “libtpclient-py/tp/client/threads.py”, line 483, in OnCacheDirty
self.application.Post(apply(self.connection, evt, self.application.cache))
File “libtpclient-py/tp/client/cache.py”, line 805, in apply
if failed(connection.insert_order(evt.id, slot, evt.change.PendingOrder)):
File “libtpproto-py/tp/netlib/client.py”, line 893, in insert_order
File “libtpproto-py/tp/netlib/client.py”, line 288, in _okfail
raise IOError(“Bad Packet was received”)
IOError: Bad Packet was received
It seems the response to sending an order to the server has changed – it no longer sends an “OK” or “Fail” packet, instead sending the order back. I’m not sure how to fix this code yet, but I’ll work on it more tomorrow. Still, orders are now sent and received properly, and the panel displays them. So it’s a step in the right direction.