Fix parsing of bookmark objects #364
Open
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.
What is this MR?
This MR fixes the bug described in #363, and includes a test to show it's working. It's arguably a breaking change, because bookmark objects will no longer contain a parsed
object
fields, but I would argue that this is fine because the parsing didn't work anyway, so it's unlikely anyone was relying on this.There are other ways of fixing this, such as handling bookmarks early and short-circuiting, but I decided to go for more minimal changes to the unmarshal logic.
How is this tested?
I added a test which includes a real payload from a bookmark event obtained when watching a kubernetes namespace, which previously would cause the client to crash.
I tested this manually by running the
bookmark_bug.py
script described in the issue, and got the expected output: