music-assistant-server

Branch:dev-lidarr-plugin

Commit Details

Deezer: fix multiple instances sharing the same account (#6169)

# What does this implement/fix?

Deezer identifies a session by the sid cookie that gw-light.php sets on
the first call, not by the arl. Both clients run on mass.http_session,
which keeps one cookie jar for the whole server, so a second instance
picked up the first one's sid and acted on the wrong account.

The gw client now sends its cookies with every request and keeps what
deezer sets in its own dict instead of the shared jar. The sid defaults
to empty, which makes deezer resolve the account from the arl again, so
a sid left behind by another instance cannot take over.

GWClient.formats was a mutated ClassVar: one list for all instances,
grown on every license refresh, leaking quality rights between accounts.
It is per instance now.

**Related issue (if applicable):**

- https://github.com/music-assistant/support/issues/6298

## Types of changes

<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives
the label from the ticked box and applies it automatically; the
release-notes generator uses that same label to slot this change
into the next release notes.
-->

- [x] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [ ] New feature (non-breaking change which adds functionality) —
`new-feature`
- [ ] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`

## Checklist

- [x] The code change is tested and works locally.
- [x] `pre-commit run --all-files` passes.
- [x] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [ ] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [ ] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [x] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have [raised a PR against the documentation
repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md)
targeting the main or beta branch as appropriate.

---------

Co-authored-by: jdaberkow <[email protected]>
Forgejo

Author

Julian Daberkow<[email protected]>
September 2, 2026 at 09:40 PM UTC

Committer

Marvin Schenkel<[email protected]>
September 4, 2026 at 07:55 AM UTC
110additions
17deletions
2files changed

Parent commits

Changes

2 files
+110-17

Changed Files (2)

music_assistant/providers/deezer/
tests/providers/deezer/
music_assistant/providers/deezer/gw_client.py
+24-17
tests/providers/deezer/test_instance_isolation.py
+86