You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that sometimes the module will hang. Investigating the logs suggersts it may not be handling a network issue well:
[30.08.2022 14:56.17.256] [ERROR] [SPOTIFY - [redacted]] Failed to request API: /v1/me/player
[30.08.2022 14:56.17.262] [ERROR] [SPOTIFY - [redacted]] Invalid request
[30.08.2022 14:56.17.273] [ERROR] (node:26841) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'headers')
at /[redacted]/modules/MMM-Spotify/Spotify.js:161:39
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
(Use `electron --trace-warnings ...` to show where the warning was created)
[30.08.2022 14:56.17.275] [ERROR] (node:26841) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
The fix I have locally is to add optional chaining to the referenced line so that it doesn't throw the error:
- if (typeof error.response.headers["retry-after"] !== "undefined") retryTimerInSeconds = error.response.headers["retry-after"]
+ if (typeof error.response?.headers["retry-after"] !== "undefined") retryTimerInSeconds = error.response.headers["retry-after"]
Happy to do a PR if you like.
The text was updated successfully, but these errors were encountered:
ioloie
changed the title
Module sometimes crashes after connectivity issues
Module sometimes hangs after connectivity issues
Aug 30, 2022
I've been running #194 locally for 2 days now without the issue re-occurring, vs. only managing a few hours beforehand so it looks to have resolved the issue.
Hey @ioloie sorry to leave your PR hanging here for two weeks. I currently don't have much time to dedicate to this project.
On that note, I remembered that I did some changes on this part already at the beginning of the year.
Could you do me a favor and evaluate the disconnect behavior against the development branch?
See also the latest commit to that branch: 453481b
I've noticed that sometimes the module will hang. Investigating the logs suggersts it may not be handling a network issue well:
The fix I have locally is to add optional chaining to the referenced line so that it doesn't throw the error:
Happy to do a PR if you like.
The text was updated successfully, but these errors were encountered: