fix(spi-transfer): ExportResult.END carried ResultType.CONTINUE - #1510
Merged
Merged
Conversation
The END constant was built with ResultType.CONTINUE, so an exporter returning it would report CONTINUE. It has no call sites in the repo, so this is latent rather than live -- but it is the obvious thing for a new exporter to reach for, and the failure is quiet: copyHelper terminates on null continuation data rather than on ResultType, so the job would complete having imported nothing.
lisad
approved these changes
Aug 18, 2026
Collaborator
Author
Ameya420
approved these changes
Aug 18, 2026
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.
Summary
ExportResultexposes two convenience constants. The second one is wrong:One character:
ENDnow carriesResultType.END.Why it matters, and why it doesn't (yet)
The constant has no call sites anywhere in the repo — every exporter constructs
new ExportResult<>(ResultType.END, ...)directly — so this is latent, not a live bug. Nothing changes for existing code.It is worth fixing anyway because it is the obvious thing for a new exporter to reach for, and the resulting failure is quiet rather than loud.
PortabilityInMemoryDataCopier#copyHelperterminates oncontinuationData == null, not onResultType:So an exporter returning
ExportResult.ENDwould not spin — the constant also carries nullexportedData, andcopyIterationskips the import entirely when that is null. The job would run toCOMPLETEhaving imported nothing at all. That is a much harder thing to notice than a hang.I hit this while writing an exporter for the offline-demo module (#1509) and worked around it there by using the enum directly. Splitting the fix out so it lands as a
fix:in its own right rather than being buried in afeat:— this repo squash-merges, so the PR title is what commitizen sees.Test plan
docker compose run --rm test --no-daemon build— full repo compiles and tests passgrep -rn "ExportResult.END" --include=*.java .— confirms the constant has no consumers, so no behaviour changes for existing callersNote for downstream consumers
portability-spi-transferis published to Maven Central. Any external caller relying on the current value ofExportResult.ENDwould be relying on it reportingCONTINUE, which is a bug rather than a contract — but it is a behaviour change for them, so it is worth a line in the release notes.