Skip to content

Fixed Auth issues - #2

Open
yukifolf wants to merge 2 commits into
bamarc:mainfrom
yukifolf:auth-issues
Open

yukifolf wants to merge 2 commits into
bamarc:mainfrom
yukifolf:auth-issues

Conversation

@yukifolf

Copy link
Copy Markdown

What changed & fixed

  • Spotify login window now always shows: Read fresh settings instead of stale startup settings, save unsaved Client ID/Secret inputs on Login, force Spotify's consent dialog (show_dialog=true), and attach the login window to the active parent window.
  • Callback now fills Client Authorization & Refresh Token: Fixed KeyError when no refresh token existed yet, triggered exchange_code_for_token after callback, kept both fields saved, synced both UI rows on the GTK main thread, parsed callback URLs with parse_qs, and stopped logging OAuth codes in URLs.
  • Fixed Repeat button: Prevented crash when Spotify is idle (None) and fixed icon lookup (was indexing a string instead of the icon list).
  • Fixed Volume Up/Down: Prevented crash when Spotify reports no active device or None volume.
  • Fixed Device Picker: Built/shown dialog on the GTK main thread, fixed close crash (wrong signal args + removed invalid Adw.Dialog.destroy()), and stopped sending duplicate device-switch requests on toggle.
  • Fixed Play/Pause UI freeze & icon lag: Cached album cover art by URL, added a 10s request timeout, moved image downloads off the GTK main thread, and updated the icon right after play/pause succeeds.
  • Fixed background polling & API handling: Handled item: null / device: null without killing the polling thread, stopped re-rendering on timestamp-only updates, paused polling when logged out or unused, prevented callback leaks with weak references, fixed 401/403 token invalidation, and accepted any 2xx response for playback controls.
  • Cleanup & tests: Synced plugin_version to 0.3.0, removed dead code (VolumeMute, DeviceType, unused helpers/imports), and added 10 unit tests (tests/test_auth.py, tests/test_controller_and_actions.py).

Testing

  • python3 -B -m unittest discover -s tests -v — 10/10 passed.

- Read fresh settings in AuthController, save unsaved Client ID/Secret on Login, pass show_dialog=true, and attach transient_for to WebAuthWindow
- Fix callback KeyError, exchange auth code for token, sync auth/refresh UI rows via GLib.idle_add, parse callback URL with parse_qs, and strip query strings from logs
- Fix Repeat icon lookup and idle crash, Volume None crash, Device Picker close/toggle/GTK-thread bugs, Play/Pause cover-art caching and async fetch, and Shuffle update guard
- Handle null item/device in polling, ignore timestamp-only updates, use weakref callbacks, fix 401/403 token invalidation, accept 2xx playback responses, sync plugin_version to 0.3.0, and remove dead code
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.

1 participant