The User's Click vs Spotify's Answer
Fastpotify's native feel is tested most sharply when the user acts faster than Spotify can confirm the action. This chapter follows that problem through the queue and playlist editing. It explains why the interface shows intent immediately, how local engine state and remote snapshots decide what is authoritative, and how sequences, anchors, snapshots, and account-scoped caches keep delayed answers from making the screen flicker backward.
A queue that responds before confirmation
Fastpotify treats the queue as more than a list returned by an endpoint. It presents two ordered regions: songs the user queued manually, under Playing next, and the tracks that follow from the current album, playlist, artist, or other context, under Next up. The manual rows play first. That arrangement is a user-facing promise about order, so a delayed response that still shows the old order cannot automatically be allowed to undo a click the user has just made.
When the user adds a song, Fastpotify places it in the visible manual region immediately. When the user presses Next, the head of an anchored queue moves into the playing position immediately. Clearing the queue removes the manually added rows while retaining the context rows. Choosing a row farther down skips the rows above it and leaves the rows after the chosen song in place. These changes give the interface a coherent answer to the action before Spotify's next response arrives.
That immediate answer is optimistic state. It is not a claim that Spotify has already confirmed the change. The client is saying, in effect, “this is what the user's action means, and this is what the interface should show while confirmation is pending.” The distinction matters because a queue read can be delayed by the network, can describe a state from before the action, or can reflect a different playback device during a handoff.
The dispatch path depends on the target. If the active target is the local player and the item is a track or episode, Fastpotify can add it directly to the local engine. Remote targets and unsupported cases use the Web API. The visible queue is updated in both cases, but the authority that will eventually confirm the change differs. The local engine can report a track event directly. A remote device is observed through later API state, so the client must allow for an older snapshot to arrive after the command.
Fastpotify also separates a queue that is useful to display from a queue that is safe to use as a prediction. A restored queue may be valuable when the last session is being shown, but if it is not anchored to the track currently reported by the player, it is not reliable evidence of where Next will land. The client leaves such rows visible without using them to invent an optimistic destination. An old list can be a helpful memory and still be unsafe as a control input.
The current track is the anchor.