android-sdk icon indicating copy to clipboard operation
android-sdk copied to clipboard

OnReceive triggered multiple times for each broadcast

Open pythymcpyface opened this issue 4 years ago • 0 comments

Issue found on 01/12/2020

SDK Version:

spotify-app-remote-release-0.7.1

OS Version:

android compileSdkVersion 30 buildToolsVersion "30.0.2"

Scope(s):

"user-library-read", "playlist-read-private", "playlist-read-collaborative", "user-read-email", "user-read-private"

Steps to reproduce:

  1. User opens app
  2. Spotify OAuth carried out successfully
  3. Playlists correctly displayed
  4. User chooses playlist and song
  5. Song correctly plays
  6. Broadcast sent from Spotify to app
  7. METADATA_CHANGED and PLAYBACK_STATE_CHANGED broadcasts correctly received with correct variables in intent
  8. Two further broadcasts with duplicate variables are then received except for the timeSentInMs variable (difference in times between broadcasts is ~100ms)

In total, three duplicate broadcasts are sent each time there is any playstate change i.e. pausing, skipping, etc

The same thing happened when downloading another user's Github project which received broadcasts in the same manner

Expected behaviour:

One broadcast was expected to be received which the app can read and handle accordingly

Actual behaviour:

Three broadcasts are received causing the app to incorrectly handle the information - requiring extra coding effort

pythymcpyface avatar Mar 01 '21 16:03 pythymcpyface