Skip to content

Fix hang on backendRequest error - #84

Open
jbandhauer wants to merge 1 commit into
volumio:masterfrom
jbandhauer:backend_request_error_fix
Open

Fix hang on backendRequest error#84
jbandhauer wants to merge 1 commit into
volumio:masterfrom
jbandhauer:backend_request_error_fix

Conversation

@jbandhauer

Copy link
Copy Markdown

_player_engine.php blocks indefinately when the state sent by the client matches the current state.
But, in the case where the backendRequest hits an error, the app starts trying to reconnect in a
setTimeout loop while it shows a modal UI. So, we don't want _player_engine to block.

This adds an option to backendRequest to send state or not for the cases we want it to block or not.

_player_engine.php blocks indefinately when the state sent by the client matches the current state.
But, in the case where the backendRequest hits an error, the app starts trying to reconnect in a
setTimeout loop while it shows a modal UI. So, we don't want _player_engine to block.

This adds an option to backendRequest to send state or not for the cases we want it to block or not.
Comment thread js/volumio.api.js

function backendRequest() {
function backendRequest(send_state) {
url = send_state ? ('_player_engine.php?state=' + GUI.MpdState['state']) : '_player_engine.php'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, been doing too much Ruby lately. This should be var url = ...

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