Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial Result Handling for EitherCodec and Collections Codec #57

Open
Cyborgmas opened this issue Feb 18, 2021 · 0 comments
Open

Partial Result Handling for EitherCodec and Collections Codec #57

Cyborgmas opened this issue Feb 18, 2021 · 0 comments

Comments

@Cyborgmas
Copy link

Not a specific issue, but rather a comment/critique of how partial results are handled in some cases.

The EitherCodec always tries to decode the left first, but always returns the right in the case of a partial result. This is even more problematic when the either has the same type, and is used to encode/decode in two different manners, perhaps then a concatenation of the two partials is wanted.

The collections codec that use apply2stable also have a problem, outlined in #55 , which discards entries after the first no-partial DataResult. Something else that might be worth considering is that currently the collection always has a partial result, but should it contain only contain the completely succesful elements of the collection? Or should it also contain the ones that have a partial result? Also, since they always have a partial result, even if all elements have failed completely, the collection will have an empty collection as a partial, which might not be desired.

See MinecraftForge/MinecraftForge#7582 for the issue that arises from minecraft's use of the EitherCodec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant