Add focused regression tests for null and duplicate message-type fields in the provider-message decoder.
The decoder must preserve the behavior of Go's JSON envelope decode when type occurs more than once. A later null value must not erase a previous string; case-variant field names must follow the same rule. An unknown type followed by null must still be rejected, and a wrong JSON type must not become valid merely because a later duplicate contains a known string.
Please add a named table test, TestProviderMessageTypeNullAndDuplicateFields, in a new protocol test file. Use explicit expected types and acceptance outcomes rather than calling the production decoder as its own oracle. Include known type then null, null then known type, a mixed-case null duplicate, unknown type then null, and a numeric duplicate. Check decoded payload content for accepted heartbeat messages.
Keep this test-only. Run the named test and the protocol suite under the race detector. If current behavior disagrees, report the exact input and explain the mismatch before changing production behavior. The PR should explain the regression cases and the checks that actually ran.
Add focused regression tests for null and duplicate message-type fields in the provider-message decoder.
The decoder must preserve the behavior of Go's JSON envelope decode when
typeoccurs more than once. A later null value must not erase a previous string; case-variant field names must follow the same rule. An unknown type followed by null must still be rejected, and a wrong JSON type must not become valid merely because a later duplicate contains a known string.Please add a named table test,
TestProviderMessageTypeNullAndDuplicateFields, in a new protocol test file. Use explicit expected types and acceptance outcomes rather than calling the production decoder as its own oracle. Include known type then null, null then known type, a mixed-case null duplicate, unknown type then null, and a numeric duplicate. Check decoded payload content for accepted heartbeat messages.Keep this test-only. Run the named test and the protocol suite under the race detector. If current behavior disagrees, report the exact input and explain the mismatch before changing production behavior. The PR should explain the regression cases and the checks that actually ran.