Skip to content

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