-
Notifications
You must be signed in to change notification settings - Fork 123
Misc upload improvements #12008
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
Misc upload improvements #12008
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,8 @@ import { | |
| replaceTrackProgressModalActions, | ||
| queueSelectors, | ||
| queueActions, | ||
| playerActions | ||
| playerActions, | ||
| BatchCachedTracks | ||
| } from '@audius/common/store' | ||
| import { | ||
| actionChannelDispatcher, | ||
|
|
@@ -429,7 +430,7 @@ export function* handleUploads({ | |
| // Channel to listen for responses | ||
| const responseChannel = yield* call( | ||
| channel<UploadTrackResponse>, | ||
| buffers.expanding(10) | ||
| buffers.expanding(200) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tbh not sure this makes any difference - the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm concerned that under the hood in react native something weird happens with this, but i agree low probability this works
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just don't understand why this complexity is even necessary in this codebase in general |
||
| ) | ||
|
|
||
| // Channel to relay progress actions | ||
|
|
@@ -453,10 +454,11 @@ export function* handleUploads({ | |
| track.metadata.artwork && 'source' in track.metadata.artwork | ||
| ? track.metadata.artwork?.source | ||
| : undefined, | ||
| trackId: track.metadata.track_id, | ||
| genre: track.metadata.genre, | ||
| moode: track.metadata.mood, | ||
| size: track.file.size, | ||
| type: track.file.type, | ||
| fileType: track.file.type, | ||
| name: track.file.name, | ||
| downloadable: isContentFollowGated(track.metadata.download_conditions) | ||
| ? 'follow' | ||
|
|
@@ -1072,10 +1074,20 @@ export function* uploadMultipleTracks( | |
| }) | ||
|
|
||
| // Get true track metadatas back | ||
| const newTracks = yield* call(retrieveTracks, { | ||
| trackIds, | ||
| forceRetrieveFromSource: true | ||
| }) | ||
| // Allow for retries in case the tracks are not immediately available | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this possible?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could be? technically the confirmer is only waiting for block numbers
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the indexer passed the block number that the uploads went in on, the track should be there... Also I think in most cases we see this error the tracks didnt upload successfully |
||
| let retries = 20 | ||
| let newTracks: BatchCachedTracks[] = [] | ||
| while (retries > 0) { | ||
| newTracks = yield* call(retrieveTracks, { | ||
| trackIds, | ||
| forceRetrieveFromSource: true | ||
| }) | ||
| if (newTracks.length > 0) { | ||
| break | ||
| } | ||
| yield* delay(2000) | ||
| retries-- | ||
| } | ||
| if (newTracks.length === 0) { | ||
| throw new Error('No tracks found after uploading.') | ||
| } | ||
|
|
||
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.
nice