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.
Changing values in repeated fields does not clear the memoized encoded value. This means that changes to repated fields after the memoized encoding has been computed will never be encoded. The pattern works for other field types because the memoized value is being cleared in the setter on the message before we call into the field. The field itself is not involved in clearing the memoized value at all.
Repeated fields are a different story. If we were completely resetting a repeated field to a new array, the memoized encoding would be correctly cleared, but because the field array we are pushing into doesn't have any concept of a message, let alone the specific message instance the field belongs to, there is no way to clear the memoized encoded message.
We need to remove the memoization until we can find a better approach.
Fixes #304.
// @film42 @abrandoned @goddardc