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

Update playlist on EntityManager #3417

Merged
merged 6 commits into from
Jul 13, 2022

Conversation

isaacsolo
Copy link
Contributor

@isaacsolo isaacsolo commented Jul 11, 2022

Description

Update playlist.

Client change sample: AudiusProject/audius-client@08c8ce7

Complete PLAT-115.

Tests

Monitoring - How will this change be monitored? Are there sufficient logs / alerts?

@isaacsolo isaacsolo changed the title Is delete playlist Update playlist on EntityManager Jul 11, 2022
@isaacsolo isaacsolo force-pushed the is-delete-playlist branch from a0b7239 to d0da025 Compare July 11, 2022 16:12
@pull-request-size pull-request-size bot added size/M and removed size/L labels Jul 11, 2022
@isaacsolo isaacsolo requested a review from hareeshnagaraj July 11, 2022 16:14
@isaacsolo isaacsolo marked this pull request as ready for review July 11, 2022 16:16
discovery-provider/src/tasks/audius_data.py Outdated Show resolved Hide resolved
libs/src/api/entityManager.ts Outdated Show resolved Hide resolved
libs/src/api/entityManager.ts Outdated Show resolved Hide resolved
libs/src/api/entityManager.ts Outdated Show resolved Hide resolved
dirCID = updatedPlaylistImage.dirCID
}

const playlist = (await this.discoveryProvider.getPlaylists(1, 0, [playlistId]))[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

could also check that the playlist owner id here matches the current user id, as an added precaution, but not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i was wondering if we should include any validation in libs but i figured we'd ignore it for now

Copy link
Contributor

Choose a reason for hiding this comment

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

great callout @jowlee - definitely worth adding, but can be done separately

const playlist = (await this.discoveryProvider.getPlaylists(1, 0, [playlistId]))[0]

const metadata = {
action, // why include action here?
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also confused why this is here, would be in favor of removing

libs/src/api/entityManager.ts Outdated Show resolved Hide resolved
libs/src/api/entityManager.ts Outdated Show resolved Hide resolved
} catch (e) {
logger.error(`Data update playlist: err ${e}`)
}
return respValues
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if on error we want to return - might be confusing from client libs consumption pov, would double check with client team / libs standard on what to do if error case

    let respValues = {
      blockHash: null,
      blockNumber: null,
      playlistId: 0
    }
    ```

Copy link
Contributor

Choose a reason for hiding this comment

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

One thing we do in other places is add smt called phases example:

const phases = {
GETTING_USER: 'GETTING_USER',
UPLOADING_TRACK_CONTENT: 'UPLOADING_TRACK_CONTENT',
ADDING_TRACK: 'ADDING_TRACK',
ASSOCIATING_TRACK: 'ASSOCIATING_TRACK'
}

so we know which step it errored on.
I would also imaging returning the error to be a better interface

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it should just error

Copy link
Contributor Author

@isaacsolo isaacsolo Jul 11, 2022

Choose a reason for hiding this comment

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

AudiusBackend will just catch anything and log it so we could simply throw with a message for now and consolidate error types later. @hareeshnagaraj probably just did this for testing purposes. this PR is just to merge into a feature branch.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah exactly, we can clean it up prior to master merge here

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jul 11, 2022
@isaacsolo isaacsolo force-pushed the is-delete-playlist branch from 21b0ca4 to 6ef5776 Compare July 11, 2022 21:05
@theoilie theoilie self-assigned this Jul 11, 2022
const playlist = (await this.discoveryProvider.getPlaylists(1, 0, [playlistId]))[0]

const metadata = {
action: updateAction, // why include action here?
Copy link
Contributor

Choose a reason for hiding this comment

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

Reason for adding the action was so that we could easily tell what the intent of this metadata was in the case we had to look it up independently for some reason - open to changing this however

Copy link
Contributor

@hareeshnagaraj hareeshnagaraj left a comment

Choose a reason for hiding this comment

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

LGTM to working branch

@isaacsolo isaacsolo merged commit 6e0f058 into hn_audius_data_write_path Jul 13, 2022
@isaacsolo isaacsolo deleted the is-delete-playlist branch July 13, 2022 17:03
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants