Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Read artist pick from discovery behind feature flag #2198

Merged
merged 3 commits into from
Nov 3, 2022

Conversation

michellebrier
Copy link
Contributor

Description

If the READ_ARTIST_PICK_FROM_DISCOVERY flag is on, read users' artist pick track ids from discovery instead of identity. I set _artist_pick on the user to the id from discovery when populating the user cache so that I didn't have to check the flag every time the artist pick value is accessed throughout the client code. Later, when everything is fully rolled out and we are ready to delete the dead code, I'll remove this switch and replace all references to _artist_pick with artist_pick_track_id throughout the client.

Dragons

Do not turn this flag on until dual writes are on + backfill has been run.

How Has This Been Tested?

On web and mobile:
Create divergence between discovery and identity artist pick track ids, insert debug statement when building user cache, make sure flag is on and artist pick is coming from discovery when loading your profile. Make sure artist pick is still 1st result in track lineup.
Turn off switch and refresh page, make sure artist pick and lineup reflect change.

How will this change be monitored?

Feature Flags

READ_ARTIST_PICK_FROM_DISCOVERY: enabled -> artist pick ids are read from discovery; disabled -> artist pick ids are read from identity

@@ -217,24 +217,6 @@ class ProfilePage extends PureComponent<ProfilePageProps, ProfilePageState> {
}
}

// Check that the sorted order has the _artist_pick track as the first
updateOrderArtistPickCheck = (tracks: Array<{ track_id: ID }>) => {
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 is not referenced anywhere and duplicates the logic in getTracks in packages/web/src/common/store/pages/profile/lineups/tracks/sagas.js so removed it.


if (user._artist_pick) {
if (!readArtistPickFromDiscoveryEnabled && user._artist_pick) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discovery API will return the artist pick track 1st based on the artist_pick_track_id in the users table so this reordering logic isn't necessary when reading/writing the artist pick to discovery

@audius-infra
Copy link
Collaborator

@michellebrier michellebrier force-pushed the mbrier/plat-414/read_artist_pick_from_discovery branch from 9c540a2 to e42776e Compare October 28, 2022 23:33
@michellebrier michellebrier requested review from a team and isaacsolo and removed request for a team October 28, 2022 23:34
@audius-infra
Copy link
Collaborator

@isaacsolo
Copy link
Contributor

isaacsolo commented Nov 3, 2022

does this also need to be changed?

https://github.com/AudiusProject/audius-client/blob/main/packages/common/src/services/audius-backend/AudiusBackend.ts#L883

@isaacsolo isaacsolo self-requested a review November 3, 2022 16:04
Copy link
Contributor

@isaacsolo isaacsolo left a comment

Choose a reason for hiding this comment

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

adding @sliptype for client review

Copy link
Contributor

@sliptype sliptype left a comment

Choose a reason for hiding this comment

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

Awesome! looks good to me

@michellebrier michellebrier force-pushed the mbrier/plat-414/read_artist_pick_from_discovery branch from bacbfb7 to 5f664e1 Compare November 3, 2022 19:00
@audius-infra
Copy link
Collaborator

@michellebrier michellebrier merged commit 0f44e9b into main Nov 3, 2022
@michellebrier michellebrier deleted the mbrier/plat-414/read_artist_pick_from_discovery branch November 3, 2022 21:55
audius-infra pushed a commit that referenced this pull request Nov 5, 2022
[218bf87] [C-1420] Show your owned albums and playlists in favorites (#2229) Andrew Mendelsohn
[aae57e5] [C-1389] Create release-candidate.staging.audius.co (#2228) Sebastian Klingler
[27c1cba] [C-1428] Fix tip reactions in notifications tab (#2226) Dylan Jeffers
[c95e341] [C-885] Update mobile environments (#2225) Sebastian Klingler
[6da6b6f] Remove prefetch first segment functionality (#2224) Raymond Jacobson
[c921ef3] Fix card padding (#2222) Raymond Jacobson
[09019ab] [C-1414] Implement mobile upload business logic (#2220) Dylan Jeffers
[0f44e9b] Read artist pick from discovery behind feature flag (#2198) Michelle Brier
[b486ecd] Fix nethermind configs for mobile (#2221) Isaac Solo
[d227c31] Use confirmer wrapper when updating user (#2199) Michelle Brier
[2b34ee1] [C-1402] Migrate upload store to common (#2215) Dylan Jeffers
[186934f] [C-882] Try to fix too often confetti bug (#2217) Raymond Jacobson
[c4439f8] Update README.md (#2216) Raymond Jacobson
[172b5f0] Update favorites table to use client side sorting and filtering when all tracks are loaded (#2213) Kyle Shanks
[3e42f18] Remove all references of new tables feature flag (#2214) Kyle Shanks
[fd0c429] [C-1283][C-1386] Offline Mode - Favorites download and playback (#2154) Andrew Mendelsohn
[6c7d9ec] FIx bad linking from a element (#2212) Joseph Lee
[490274a] Set animationFinished based on opacity animation (#2211) Sebastian Klingler
[edc298d] PAY-716 Take user to trending at end of BuyAudio flow (#2210) Marcus Pasell
[6c12b8c] [C-1394] Add uploading and upload-complete screens (#2206) Dylan Jeffers
[7b4c3fa] Fix restore_cache (#2209) Dylan Jeffers
[4fb5896] Prepare mobile-nav-overhaul for release (#2208) Dylan Jeffers
[5da0015] [C-1395, C-1398] Add listening history to account drawer (#2207) Dylan Jeffers
[6567487] Update secondary screen background color (#2205) Dylan Jeffers
[16fc962] Fix cover photo button alignment (#2204) Raymond Jacobson
[8597b76] [C-1323] Somewhat improve upload metrics (#2187) Raymond Jacobson
[cf0907e] PAY-687 Add new UI to tipping linking to the BuyAudio flow (#2195) Marcus Pasell
[df88393] Fix upload (#2201) Joseph Lee
[f1c28bd] Use feature flag for mp3 stream toggle (#2202) Andrew Mendelsohn
[3662880] [C-1383] Add upload track form (#2200) Dylan Jeffers
[b5f6926] Add notification navigation hook and update profile screen to accept id param (#2194) Kyle Shanks
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants