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

Fix track association so it only errors if files found < files expected #904

Merged
merged 3 commits into from
Oct 9, 2020

Conversation

dmanjunath
Copy link
Contributor

Trello Card Link

Description

Services

  • Discovery Provider
  • Creator Node
  • Identity Service
  • Libs
  • Contracts
  • Service Commands
  • Mad Dog

Does it touch a critical flow like Discovery indexing, Creator Node track upload, Creator Node gateway, or Creator Node file system?

Delete an option.

  • 🚨 Yes, this touches upload. It's the second leg of upload which is the association of trackBlockchainId

How Has This Been Tested?

It hasn't, yet

Please list the unit test(s) you added to verify your changes.

None

@@ -313,8 +313,7 @@ module.exports = function (app) {
const existingTrackEntry = await models.Track.findOne({
where: {
cnodeUserUUID,
blockchainId: blockchainTrackId,
coverArtFileUUID
blockchainId: blockchainTrackId
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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

Copy link
Contributor

@SidSethi SidSethi left a 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

@dmanjunath dmanjunath merged commit c407cf8 into master Oct 9, 2020
@dmanjunath dmanjunath deleted the dm-fix-track-associate-hotfix branch October 9, 2020 02:52
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.

None yet

3 participants