-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix track association so it only errors if files found < files expected #904
Conversation
…o dm-fix-track-associate-hotfix
@@ -313,8 +313,7 @@ module.exports = function (app) { | |||
const existingTrackEntry = await models.Track.findOne({ | |||
where: { | |||
cnodeUserUUID, | |||
blockchainId: blockchainTrackId, | |||
coverArtFileUUID | |||
blockchainId: blockchainTrackId |
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.
What was happening here is we were using the coverArtFileUUID for the existing track check which means if the cover art was changed, this check would fail and it would treat this as a new upload and fail because there were no unassociated files
@@ -381,7 +380,8 @@ module.exports = function (app) { | |||
transaction | |||
}) | |||
|
|||
if (trackFiles.length !== trackSegmentCIDs.length) { | |||
if (trackFiles.length < trackSegmentCIDs.length) { |
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.
this also takes care of the case where a previous track_content left unassociated files. we'd error if the number of files is not exactly equal (so duplicates would break). this way we'll associate it all under this trackId. See https://github.com/AudiusProject/audius-protocol/blame/3bf6a8137ae25529583f21ac259562c712e8b3b5/creator-node/src/routes/tracks.js for previous behavior
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.
my bad, thanks for fixing
Trello Card Link
Description
Services
Does it touch a critical flow like Discovery indexing, Creator Node track upload, Creator Node gateway, or Creator Node file system?
Delete an option.
How Has This Been Tested?
It hasn't, yet
Please list the unit test(s) you added to verify your changes.
None