Skip to content

Commit 881cf1e

Browse files
Clarify type change safety in proto best practices
PiperOrigin-RevId: 937378172
1 parent 024b66f commit 881cf1e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

content/best-practices/dos-donts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ To safely remove the original name (if it's being used for interchange, which it
7272
Almost never change the type of a field; it'll mess up deserialization, same as
7373
re-using a tag number. The
7474
[protobuf docs](/programming-guides/editions#updating)
75-
outline a small number of cases that are okay (for example, going between
76-
`int32`, `uint32`, `int64` and `bool`). However, changing a field’s message type
77-
**will break** unless the new message is a superset of the old one.
75+
outline cases where old binary encoded data may successfully parse under a
76+
different type (for example, going between `int32`, `uint32`, `int64` and
77+
`bool`). However, changing a field's type can be difficult to roll out safely
78+
even when the new schema can successfully parse old data.
7879

7980
<a id="dont-add-a-required-field"></a>
8081

0 commit comments

Comments
 (0)