My client often receives the following message container from the telegram server, seemingly at random:
{'MessageContainer': [{'msg': {u'bad_msg_notification': {u'bad_msg_seqno': 4, u'bad_msg_id': 6330589643093583872L, u'error_code': 35}}, 'seqno': 4, 'msg_id': 6330589645303624705L}, {'msg': {u'msgs_ack': {u'msg_ids': [6330589643093583872L]}}, 'seqno': 4, 'msg_id': 6330589645303639041L}]})
You may notice: ‘error code’: 35 above, but there is no description of what that error code means. So far I have been ignoring it but that is not a good long term solution IMHO. Any ideas what that error code means?
2
Answers
As Telegram API docs says, error with code 35 is “odd msg_seqno expected (relevant message), but even received”
There are a set of errors associated with bad_msg_seqno
From the documentation:
Formal Definition: Message Sequence Number (msg_seqno)
Notes:
server_seq_no
which should be 1 greater than your correct max seq_no so far.server_seq_no
(which should always be even) to confirm what yourcurrent-expected
seq_no should be, and adjust as required.The above technique has worked for me in avoiding these intermittent error messages completely.