Skip to content

Commit ea3eb0b

Browse files
fix(watch): meta version detection
Originally the handshake protocol-version check used && instead of || which would only reject when both major and minor version were different, so a 3.0 meta would work with a 2.0 watch. The fix just stops checking the minor version in the handshake so the minor version can be bumped to indicate new fields were added to the end of messages, without breaking compatibility with older Watch versions that should just ignore those fields.
1 parent 0cc52a7 commit ea3eb0b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

watch/internal/metadata/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (m *Manager) handleV2Connection(conn net.Conn, connMutex *sync.Mutex, cance
301301
handshakeResp := &HandshakeResponse{}
302302
if !handler.recv(handshakeResp) {
303303
return
304-
} else if handshakeResp.Major != m.eventVersion.major && handshakeResp.Minor != m.eventVersion.minor {
304+
} else if handshakeResp.Major != m.eventVersion.major {
305305
m.log.Error("unsupported metadata event protocol detected",
306306
zap.String("metaProtocolVersion", fmt.Sprintf("%d.%d", handshakeResp.Major, handshakeResp.Minor)),
307307
zap.String("watchProtocolVersion", fmt.Sprintf("%d.%d", m.eventVersion.major, m.eventVersion.minor)))

0 commit comments

Comments
 (0)