Skip to content

[QA-1827] Fix queuing short profile lineups issue#10451

Merged
schottra merged 1 commit intomainfrom
qa-1827
Nov 18, 2024
Merged

[QA-1827] Fix queuing short profile lineups issue#10451
schottra merged 1 commit intomainfrom
qa-1827

Conversation

@schottra
Copy link
Contributor

Description

This is a fun one. The behavior exhibited is:

  1. Start playing a track (from the feed is a good source)
  2. Navigate to a profile with less than 3 tracks on it. Or scroll through the tracks in the profile until you've loaded the entire lineup for said profile.
  3. Play a track from the profile that's less than 3 items from the end of the list
  4. Watch the track feed disappear.

What's actually happening to cause this:
We have some logic in the queue saga that checks if the queue has less than 3 items in it. If so, and we're currently playing from a lineup source, it will trigger a fetch on that lineup to further populate the queue. But it uses the artist of the currently playing track as input to the lineup selector. For a profile lineup selector, that's only valid if the currently playing track is a track from said profile. But due to where this logic lives, the "current track" will be likely from a different artist than the profile lineup we just queued. If that's confusing, here's the order of operations that was happening:

  1. Hit play on feed, queuing state gets set to the feed lineup with all the items in it. We start playing whatever item you selected. (Purposely skipping a bunch of substeps here)
  2. Hit play on an item from any profile other than the artist currently playing
  3. The Profile lineup saga will clear the queue, then insert the item any fetched items after that item in the profile lineup. Then it calls play() to tell the queue saga to play the item you just selected.
  4. The queue saga runs, checks the current queue to see if we're close to the end (always true for a 1 item profile lineup), calls fetchLineupTracks to make sure that we get any additional lineup items that may not have been fetched yet.
  5. fetchLineupTracks reads the current source from the queue (which is now the profile lineup items), then attempts to get the lineup entry for that source (which again is a profile lineup now), then reads the currentArtist from the player state and attempts to look up the profile saga state for that artist.
  6. fetchLineupTracks calls into the profile saga for that "current artist" to get more items, not the profile saga for the artist owning the track you just started playing from the profile page. Since the profile lineup for the "current" artist in the player was likely never fetched (unless you visited their profile already), it's going to be in an IDLE state, with no handle set. And that's going to cause things to blow up.
  7. If you do not pass a handle to profile/profile lineup sagas, it defaults to using the currentUser, which is the user whose profile you currently have open (or maybe last browsed to? I don't think we clear it on unmount). So when the fetch begins, we clear the current user profile lineup. And when it fails, we obviously are left with no tracks in the current user profile lineup.

There's a lot going on here, and it's pretty messy. And lineups need to die.
For right now, I think using the handle for the user whose track you are attempting to play is a better strategy for checking the lineup then the user whose track is currently in the player.

I'm open to suggestions here, because I don't have a complete understanding of all the ways we end up in queue sagas.

How Has This Been Tested?

Tested manually in local client against staging. Not sure if I exercised all the possible flows.

@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2024

⚠️ No Changeset found

Latest commit: cfe1609

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@schottra schottra merged commit 5484dac into main Nov 18, 2024
@schottra schottra deleted the qa-1827 branch November 18, 2024 15:30
audius-infra pushed a commit that referenced this pull request Nov 23, 2024
[34d450f] QA ticket grab bag (#10514) Raymond Jacobson
[ccb7082] [PAY-3607] Migrate explore tracks to sdk (#10509) Reed
[bb6828e] [PAY-3503] Update no longer can message user UI (#10505) Reed
[80c700e] Revert "[C-5342] Upgrade react-native to 0.75 (#10301)" (#10497) Andrew Mendelsohn
[bb06fba] Fix sidebar playlists account sync (#10495) Isaac Solo
[047598a] [C-5405] Update upload flow with file replace (#10494) Kyle Shanks
[e1bc4ca] [QA-1842] Fix web date picker time default (#10491) Isaac Solo
[2fdfd7b] Remove PREFER_HIGHER_PATCH_FOR_PRIMARY/SECONDARIES feature flags (#10480) Reed
[2736806] [C-5410] Add ReplaceTrackConfirmation modal (#10489) Kyle Shanks
[8c52795] [C-5408] Move delete track action to overflow menu (#10487) Kyle Shanks
[4cfea48] [C-5395 & C-5396] Upgrade to amplitude v2 and enable session replay (#10463) JD Francis
[d6f43a6] Fix watchQueueAutoplay test (#10488) Andrew Mendelsohn
[4d15579] [C-5430] Add feature flag for track audio replace (#10482) Kyle Shanks
[7820db8] Remove AI_ATTRIBUTION feature flag (#10476) Reed
[09ec89b] [C-5404] Add FileReplaceContainer component to web (#10462) Kyle Shanks
[14756ed] Remove DISCOVERY_TIP_REACTIONS feature flag (#10479) Reed
[92eed35] Remove DEVELOPER_APPS_PAGE feature flag (#10477) Reed
[f242d87] Remove SDK_DISCOVERY_NODE_SELECTOR feature flag (#10474) Reed
[ec135ba] Remove LAZY_USERBANK_CREATION_ENABLED feature flag (#10473) Reed
[bc4452e] Remove misc feature flags (#10478) Reed
[980e2b0] Remove RELATED_ARTISTS_ON_PROFILE_ENABLED feature flag (#10475) Reed
[4d76fbe] Remove PODCAST_CONTROL_UPDATES_ENABLED feature flag (#10471) Reed
[914b46b] Remove EARLY_ACCESS feature flag (#10469) Reed
[5d0a9ed] Remove RATE_CTA_ENABLED feature flag (#10467) Reed
[61e9ddf] Remove OFFLINE_MODE_RELEASE feature flag (#10466) Reed
[85fb740] [C-5403, C-5411] Add Upload icon to harmony (#10459) Kyle Shanks
[d51cc3c] [QA-1840] Fix Offline Mode errors (#10460) Andrew Mendelsohn
[9a0603f] [C-5416] Basic guest checkout behind feature flag (#10447) Isaac Solo
[38e007c] [C-5417] Update track audio replace for sdk change (#10458) Kyle Shanks
[8455921] Remove TIPPING_ENABLED feature flag (#10457) Reed
[0403468] Remove SOLANA_LISTEN_ENABLED feature flag (#10456) Reed
[a93a826] Fix track edit sdk issues (#10450) Sebastian Klingler
[5484dac] [QA-1827] Fix queuing short profile lineups issue (#10451) Randy Schott
[c4ef1e0] Fix bad useEffects calls in PremiumContentPurchaseDrawer (#10454) Randy Schott
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.

2 participants