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

Add support for ordered collections of strings. #92

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gmale
Copy link

@gmale gmale commented Oct 1, 2020

While using this library with ordered sets, I encountered a critical bug that would silently permute values because sets would be saved in order but loaded in random order! This was particularly bad for storing large keys, broken down into chunks. When restored, the values would change!! What made it so bad is that it would often work because sometimes the random order would match the initial order. So it got through several layers of testing, unnoticed.

This PR addresses the root issue by adding support for storing lists. Since Lists are inherently ordered, they are a more attractive option for developers who are breaking down large strings for storage. Also, the getStringSetValue function has been modified to use a LinkedHashSet under the hood, which is a non-breaking change but also makes it compatible with ordered sets.

Along the way, I encountered other bugs that I documented as github issues and fixed, as well. Lastly, I added unit tests in the style of existing tests to verify all new functionality.

All tests pass.

Kevin Gorham added 5 commits September 30, 2020 20:21
This better serves the usecases of storing ordered strings since Lists are expected to be ordered. Also adjusts the Set behavior to be compatible with ordered sets.
Closes adorsys#91
@gmale
Copy link
Author

gmale commented Oct 1, 2020

It's unclear why that check fails. All tests pass locally. @drilonrecica any ideas?

Screenshot from 2020-09-30 21-27-25

@gmale
Copy link
Author

gmale commented Dec 3, 2020

Is there anyone who can review this?

@Linlinthu1991
Copy link

gmale:bugfix/ordered-sets

``

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

Successfully merging this pull request may close these issues.

2 participants