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

ZMS-172 #733

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

ZMS-172 #733

wants to merge 19 commits into from

Conversation

NickOvt
Copy link
Contributor

@NickOvt NickOvt commented Sep 13, 2024

When an attachment gets uploaded calculate sha256 hash of it's content and store in the file metadata in the DB.

@NickOvt NickOvt self-assigned this Sep 13, 2024
lib/attachments/gridstore-storage.js Outdated Show resolved Hide resolved
}
);
}
}
callback(...args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a potential race condition if we want to use the sha256 hash immediately after the attachment has been uploaded - there's a chance that the findOneAndUpdate call is not finished yet, and thus, the value is not available.

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