-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[spotify] Potential wrong expiry value is used for ExpiringCache #10490
Labels
bug
An unexpected problem or unintended behavior of an add-on
Comments
Hilbrand
added a commit
to Hilbrand/openhab-addons
that referenced
this issue
Oct 11, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox. Signed-off-by: Hilbrand Bouwkamp <[email protected]>
Hilbrand
added a commit
to Hilbrand/openhab-addons
that referenced
this issue
Oct 11, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). Signed-off-by: Hilbrand Bouwkamp <[email protected]>
Hilbrand
added a commit
to Hilbrand/openhab-addons
that referenced
this issue
Oct 11, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). Signed-off-by: Hilbrand Bouwkamp <[email protected]>
Hilbrand
added a commit
to Hilbrand/openhab-addons
that referenced
this issue
Oct 11, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). Signed-off-by: Hilbrand Bouwkamp <[email protected]>
Hilbrand
added a commit
to Hilbrand/openhab-addons
that referenced
this issue
Oct 11, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). - Fixed device list update problem for devices. If no devices where configured as separate things (or the devices added where offline, but non added where not offline) the list was not updated. Signed-off-by: Hilbrand Bouwkamp <[email protected]>
fwolter
pushed a commit
that referenced
this issue
Oct 24, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes #6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes #10490). - Improved handling Spotify API error messages (Closes #11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes #7400). - Fixed device list update problem for devices. If no devices where configured as separate things (or the devices added where offline, but non added where not offline) the list was not updated. Signed-off-by: Hilbrand Bouwkamp <[email protected]>
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/spotify-connect-binding-available/66809/262 |
dschoepel
pushed a commit
to dschoepel/openhab-addons
that referenced
this issue
Nov 9, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). - Fixed device list update problem for devices. If no devices where configured as separate things (or the devices added where offline, but non added where not offline) the list was not updated. Signed-off-by: Hilbrand Bouwkamp <[email protected]> Signed-off-by: Dave J Schoepel <[email protected]>
NickWaterton
pushed a commit
to NickWaterton/openhab-addons
that referenced
this issue
Dec 30, 2021
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). - Fixed device list update problem for devices. If no devices where configured as separate things (or the devices added where offline, but non added where not offline) the list was not updated. Signed-off-by: Hilbrand Bouwkamp <[email protected]> Signed-off-by: Nick Waterton <[email protected]>
nemerdaud
pushed a commit
to nemerdaud/openhab-addons
that referenced
this issue
Jan 28, 2022
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). - Fixed device list update problem for devices. If no devices where configured as separate things (or the devices added where offline, but non added where not offline) the list was not updated. Signed-off-by: Hilbrand Bouwkamp <[email protected]>
marcfischerboschio
pushed a commit
to bosch-io/openhab-addons
that referenced
this issue
May 5, 2022
Enhancements: - Added play actions to start a track or other via a rule. - Added albumImageUrl with the url to the album image to not have to send the whole image via the openHAB eventbus. - Added a parameter imageIndex to set the image size to use (0, 1 or 2) to channels albumImage and albumImageUrl. - Added offset and limit parameters to playlists channel (Closes openhab#6843). Fixes: - Fixed invalid expire value set on ExpiringCache (Closes openhab#10490). - Improved handling Spotify API error messages (Closes openhab#11308). - Added TTL to discovery results to fix duplicated Spotify Connect devices reported in the inbox (Closes openhab#7400). - Fixed device list update problem for devices. If no devices where configured as separate things (or the devices added where offline, but non added where not offline) the list was not updated. Signed-off-by: Hilbrand Bouwkamp <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
I'm currently developing a new binding and use the spotify binding as a reference for the usage of the OAuth workflow.
After I inspected the
SpotifyBridgeHandler
code I noticed that bothplayingContextCache
anddevicesCache
are usingconfiguration.refreshPeriod
as theexpiry
value for the cache. This refreshPeriod is described in thing-types as "Connect Refresh Period (seconds)" but ExpiringCache requires aDuration
or along
value that represents the duration in milliseconds according to the JavaDoc.I wanted to ask if this is intended (since it seems to work without spamming calls to the API every 10ms?) or if it should be changed to something like
Duration.ofSeconds(configuration.refreshPeriod)
like I saw in other bindings?Current Behavior
Both
devicesCache
andplayingContextCache
are using an int value that is supposed to represent a second value as a parameter that expects a milliseconds value.openhab-addons/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyBridgeHandler.java
Line 290 in 1661425
openhab-addons/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyBridgeHandler.java
Line 292 in 1661425
Possible Solution
Use
Duration.ofSeconds(configuration.refreshPeriod)
instead ofconfiguration.refreshPeriod
.Your Environment
The text was updated successfully, but these errors were encountered: