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

Health API: Fix for MissingContentDir wrong #152

Closed
infeo opened this issue Dec 2, 2022 · 0 comments
Closed

Health API: Fix for MissingContentDir wrong #152

infeo opened this issue Dec 2, 2022 · 0 comments
Assignees
Labels
Milestone

Comments

@infeo
Copy link
Member

infeo commented Dec 2, 2022

Per spec, the content directory in cipher space consists of 32 characters representing the SHA1 hash of the directory id. (for an example, see spec)

The result MissingContentDir indicates, that for an existing dirId, the content dir is missing. The fix is to create the directory.
But looking at the code to fix it, it is wrongly implemented:

Path dirPath = pathToVault.resolve(Constants.DATA_DIR_NAME).resolve(dirIdHash.substring(0, 2)).resolve(dirIdHash.substring(2, 30));

Java substring method takes two indices, not a start index and a length.

@infeo infeo added the bug label Dec 2, 2022
@infeo infeo added this to the 2.5.2 milestone Dec 2, 2022
@infeo infeo self-assigned this Dec 2, 2022
infeo added a commit that referenced this issue Dec 2, 2022
@infeo infeo closed this as completed in 6d51f86 Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant