-
Notifications
You must be signed in to change notification settings - Fork 101
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
Further work on checksums #1020
Conversation
@@ -415,7 +432,7 @@ public String toString() { | |||
} | |||
} | |||
} else { | |||
ofile.setHash(sha1()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should hasher
be set here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't actually have easily to hand a useful value it could set it with. With the codepaths as they are I think I satisfied myself that the PublicRepository
file
method accessing new files (probably?) wasn't a problem in this regard, and in RepositoryDaoImpl.createOriginalFile
that does now have the relevant information so hasher
gets set there instead.
If the story were less simple, though, then I'd be inclined toward a refactoring of CheckedPath
and its clients that has it cache with which CheckedAlgorithm
instance it was created; perhaps that is a direction we will go in anyway someday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's happening later in processing, then no worries. Don't now if you want a TBD/TODO here to remind us, or if it will just happen naturally when we refactor. Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'll happen naturally: given what we'll have to look at, it'll be hard not to notice.
This certainly looks sounds:
|
Attaching a file in the web client to
|
Oooh, I didn't even know we could attach files in the web client. Fix that as a separate PR? (I assume this one doesn't actually change that behavior at all.) |
So this is likely a hold over from your last round of fixes of "fake" hash values? If so, no real harm. The culprit is likely:
/cc @bpindelski: these are the type of other upload code paths I was mentioning. |
Thanks for the pointer -- yes, I'd simply missed it before through not knowing of that upload path. |
Couple of todos under 10338 and 2581, but generally sound. Merging so @bpindelski's next PR can be rebased on top. |
--no-rebase |
To test, try importing and suchlike to make sure that imports and viewing still work as before, and watch the
originalfile
table in the database to ensure that itshash
andhasher
columns are properly populated.