/
/
# What does this implement/fix? <!-- Quick description and explanation of changes. --> Re-authenticating the Audible provider with a different marketplace kept querying the old one until a full server restart, silently syncing zero items. Two causes: - The provider kept a class-level authenticator cache keyed on the provider instance id, so a reconfigure (which keeps the instance id but writes a new auth file) kept using the stale authenticator for the previous registration. Rely on the file-path keyed cache instead, which naturally picks up the new auth file. - Auth files written by older versions can hold the marketplace that was active before the locale change. The configured locale is now treated as authoritative when loading the auth file, and a mismatching file is corrected in place, healing existing broken setups without requiring re-authentication. Also clean up after a replaced or removed registration: a successful re-authentication now deregisters the previous virtual device (best-effort) and removes its token file, and removing the provider removes its token file as well. Covered by unit tests that reproduce the reported broken state (auth file marketplace ≠ configured locale) against the real audible library and assert the corrected file and API domain but not tested against a live Audible account. **Related issue (if applicable):** - related issue https://github.com/music-assistant/support/issues/6076 ## 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: Claude <[email protected]>