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

Use BTreeMap instead of HashMap for source bundle manifest #489

Merged

Conversation

Jake-Shadle
Copy link
Contributor

I noticed this when reimplementing some of sentry-cli's upload-difs portions, basically the exact same input objects (in our case wasm binaries + source bundles) would always say there were missing chunks on the server, The cause of which was the use of a HashMap to store the files in the source bundle manifest, which will give non-deterministic output with the same input due to the default HashMap hash randomization. Changing to use a BTreeMap gives deterministic ordering so that the same input object will always give the same output source bundle.

Also just want to note, the only reason that this is the case is that PR #470 changed the zip crate to remove default features, one of which is time, which when not present will always use 1980-01-01 for the timestamp.

@Swatinem Swatinem merged commit d05ca16 into getsentry:master Jan 12, 2022
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