Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After this change, we're not fully processing the server's response leading to some weird behavior... like the client & server getting stuck since the client is not providing the expected
exchange-token
orsequence
. And we end up not processing any messages hours after registration:This behavior can be seen with the latest snap revisions from the
edge
channel (probably all revisions after revision 244).Cause
Server responses look like:
yet, the ServerResponse class looks like this:
which means that after this asdict, the response passed to
MessageExchange._handle_result
looks like this 👇 yet that function expects the original response as is.Fix
Process the full server response while retaining the original field types (i.e. keeping
bytes
instead ofstr
as before) andkebab-case
while processing the message.The server provides
next-exchange-token
asbytes
& the client has been storing it that way. We need to convert it tostr
before using it as a header value inlandscape.client.exchange.exchange_messages
. After this change, we dropped that conversion which creates a bad header inlandscape.lib.fetch.fetch
(line 102):When the server receives this bad exchange token, it forces the client to re-register creating a clone :(.