FoxxMD / multi-scrobbler

Scrobble plays from multiple sources to multiple clients
https://foxxmd.github.io/multi-scrobbler
MIT License
346 stars 16 forks source link

Maloja conflicts cause an error #131

Closed duckfromdiscord closed 6 months ago

duckfromdiscord commented 8 months ago

Describe the bug Duplicate backlog scrobbles error and sometimes retry scrobbling.

To Reproduce Steps to reproduce the behavior:

  1. Listen to music
  2. Stop and start multi-scrobbler

Expected behavior Duplicates should be dropped and ignored.

Logs

2024-01-27T01:01:33+00:00 error   : [Scrobblers] [Maloja - myMaloja] Scrobble processing interrupted
2024-01-27T01:01:33+00:00 error   : [Scrobblers] [Maloja - myMaloja] Error occurred while trying to scrobble
ErrorWithCause:
    at m.doProcessing (CWD/build/server.js:1:46066)
    at async m.startScrobbling (CWD/build/server.js:1:42862)

caused by: Error: Conflict
    at Request.callback (CWD/node_modules/superagent/lib/node/index.js:845:17)
    at CWD/node_modules/superagent/lib/node/index.js:1070:18
    at IncomingMessage.<anonymous> (CWD/node_modules/superagent/lib/node/parsers/json.js:21:7)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2024-01-27T01:01:33+00:00 info    : [Scrobblers] [Maloja - myMaloja] Scrobble processing retries (4) less than max processing retries (5), restarting processing after 64 second delay...
2024-01-27T01:01:38+00:00 debug   : [Sources] [Spotify - MySpotify] Refreshing recently played
2024-01-27T01:01:38+00:00 debug   : [Sources] [Spotify - MySpotify] No new tracks discovered
2024-01-27T01:01:38+00:00 debug   : [Sources] [Spotify - MySpotify] Last activity was at 2024-01-27T01:00:26+00:00. Will check again in interval 10.00 seconds.
2024-01-27T01:01:38+00:00 verbose : [Sources] [Spotify - MySpotify] Sleeping for 10.00s

Versions (please complete the following information): Provide version information for any related sources/clients.

Additional context It seems like maloja API errors when you try to put another scrobble at the exact same time as another one. Perhaps there should be a debug log that will automatically be written for these so we can see why there are double scrobbles. Either way, they should be ignored.

FoxxMD commented 6 months ago

I believe this should have been fixed with feat(maloja): Improve error handling -- it refactored maloja error handling to only be "scrobbling interrupting" if the error is a network issue or HTTP status is >=500, otherwise it just adds the scrobble to the failed queue and records the reason.

Commit is earlier than your issue because it was in develop and not in the flatpak release when this issue was raised.

duckfromdiscord commented 6 months ago

It will be difficult to reproduce this issue now that the problems causing the double scrobbling in the first place are fixed

FoxxMD commented 6 months ago

It can be re-opened if someone experiences this again.