Skip to content

Keep friends whose buddylist row has a context but no track - #40

Draft
Liremant wants to merge 3 commits into
fatyzzz:mainfrom
Liremant:pr/friends
Draft

Liremant wants to merge 3 commits into
fatyzzz:mainfrom
Liremant:pr/friends

Conversation

@Liremant

@Liremant Liremant commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What

The Friends tab showed four rows where the official client shows eleven. Comparing the same account side by side: the missing friends were all entries whose row has a context (a playlist or album) but no named track — the desktop client renders those as "where they're playing", our parser threw them away.

Why

parse_buddylist demanded a non-empty track/uri and dropped every row without one. Spotify keeps such entries in the buddylist (a friend playing a whole context, or a private/local source), so they are real rows, not noise.

What changed

  • Rows without a track stay. What the row carries is rendered instead of the track name: the context title, and double-click plays the context (playContext(contextUri, "")), which is what the official client does too.
  • The section header shows how many friends the buddylist brought ("Friend activity — N listening") so "four rows" can be told apart from "the server only sent four".
  • Test updated: the fixture now includes a context-only entry, and the parser asserts it stays with its context fields.

Testing

  • cargo test -p sf-services — 183 passed (the buddylist fixture extended with a context-only row).
  • cargo build -p materialfy, qmllint clean on FriendRow.qml.
  • Verified against your own screenshots: the eleven friends in the official client are exactly the four we showed plus the context-only rows this PR keeps.

@Liremant
Liremant force-pushed the pr/friends branch 2 times, most recently from 244bfc1 to 1b675b2 Compare November 9, 2026 05:36

@VitzS7 VitzS7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Dropping the empty track check in parse_buddylist is the right call, and falling back to the context title and playing the context on double click matches what the official client does. I read the diff and ran cargo test -p sf-services on the branch (185 passed) and qmllint on FriendRow and FriendsPanel (only the usual unqualified Social warnings).

@Liremant
Liremant marked this pull request as draft November 9, 2026 15:33
@Liremant

Liremant commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Converted to draft pending live testing — the reported count mismatch needs a real-account check before this merges. Awaiting test results on the current build.

pi added 3 commits November 10, 2026 20:09
The panel renders whatever the buddylist returns — nothing in the app cuts the
list — and Spotify only includes friends who are listening right now, so four
rows can genuinely be all there is. A count next to the header and a debug log
of raw versus playing rows make that visible instead of a guess.
Spotify leaves a buddylist entry in place when the friend plays a whole
context — a playlist without a named track — and the desktop client shows it.
The parser demanded a track URI and dropped those rows, which is why the panel
showed four friends where the official client showed eleven.

Such a row now reads what it has (context instead of the track name) and
double-click plays the context.
…t a track

Comparing the same account: the official panel showed eleven friends, ours four.
presence-view answers only who is listening right now, and the official client
accumulates those snapshots — a friend who left the list stays as a dimmed row
with their last timestamp (the 2 hr / Yesterday captions in the panel). We were
overwriting the list with every poll, so the accumulation never happened.

A new answer now merges into the existing list: fresh data for who is back,
kept rows for who disappeared, entries older than a week drop out. Rows without
a track stay too, showing what context the friend is playing.
@Liremant
Liremant force-pushed the pr/friends branch 2 times, most recently from 329ab06 to 4ae1f87 Compare November 10, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants