Repository navigation
Conversation
…n field FDV2PL 3.4 makes the payload-transferred version field optional and deprecated: it has no meaning, and SDKs must treat it as absent. The parser threw when the field was missing and failed on any non-integer value. It now reads a missing or non-integer version as 0. An integer version is still kept, so getVersion() and the selector are unchanged for every payload that parses today.
Author
|
All checks have passed across three CI runs, including |
bradbunce
marked this pull request as ready for review
November 20, 2026 15:02
tanderson-ld
approved these changes
Nov 20, 2026
tanderson-ld
self-requested a review
November 20, 2026 18:21
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requirements
Tested on JDK 17 locally and on JDK 8 in CI, which is the only version
lib/shared/internal's CI job runs. Not tested on Java 11 or Android. The change is plain parsing code with no version-specific APIs.Related issues
payload-transferred) in sdk-specs:versionis optional and deprecated. It "has no semantic meaning", and new SDK implementations "MUST treat this field as being absent".Describe the solution you've provided
PayloadTransferred.parseno longer rejects apayload-transferredevent that has noversionfield, or whoseversionisn't an integer. Today it throwsSerializationExceptionin both cases. If the service stopped sending the field, which the spec allows, every FDv2 payload would fail to parse in every SDK built on this library.versionis read as0.versionthat isn't a whole number fitting in anintis skipped and read as0. That includesnull, strings, fractions, out-of-range numbers, objects and arrays.versionis still kept, sogetVersion(), and the selector version the protocol handler builds from it, are unchanged for every payload that parses today.stateis still required.getVersion()and the constructor now says the field is deprecated and meaningless.Tests:
FDv2PayloadsTest:payloadTransferred_ThrowsWhenVersionFieldMissingis replaced bypayloadTransferred_TreatsMissingVersionAsZero.FDv2PayloadsTest: newpayloadTransferred_TreatsNonIntegerVersionAsZeroandpayloadTransferred_KeepsAnIntegerVersion.FDv2ProtocolHandlerTest: newpayloadTransferred_WithoutVersionCompletesTheTransfer.lib/shared/internalpass.Describe alternatives you've considered
Ignoring the field entirely, even when it's an integer, as the spec's "MUST NOT parse or use its value" suggests. That would change
getVersion()andSelector.getVersion()for existing callers, so I left it as a separate decision. Nothing in the server SDK reads the selector version today.Additional context
The service currently sends
"version": 0, so this doesn't change behavior against today's service. It removes a parse failure if the field is ever omitted.Note
Overview
Aligns
PayloadTransferredparsing with FDv2 spec 3.4: the deprecatedversionfield is no longer required, and malformed values no longer fail deserialization.PayloadTransferred.parsedefaults missingversionto 0, parses integer values when present, and maps any non-integer JSON (null, strings, floats, objects, etc.) to 0 via newreadOptionalInt. Onlystateremains required. Javadoc now documents thatversionis deprecated and meaningless.Tests replace the “missing version throws” case with coverage for missing, invalid, and valid integer versions, plus a protocol-handler test confirming a
payload-transferredevent with onlystatestill completes a full transfer.Reviewed by Cursor Bugbot for commit 9bbcdc5. Bugbot is set up for automated code reviews on this repo. Configure here.