Skip to content

Server comm failure callbacks#1756

Closed
joescii wants to merge 6 commits intomasterfrom
server-comm-failure-callbacks
Closed

Server comm failure callbacks#1756
joescii wants to merge 6 commits intomasterfrom
server-comm-failure-callbacks

Conversation

@joescii
Copy link
Contributor

@joescii joescii commented Jan 25, 2016

In this PR I added front-end hooks for applications to be notified of possible server communication problems. There are 4 new public methods on lift:

lift.addAjaxOnCommFailure()
lift.addAjaxOnCommSuccess()
lift.addCometOnCommFailure()
lift.addCometOnCommSuccess()

With these in place, it is possible for an app to show the user that server communication has potentially been lost after some threshold number of failure events for instance.

See relevant ML thread.

…h addAjaxOnCommFailure, addAjaxOnCommSuccess, addCometOnCommFailure, and addCometOnCommSuccess
…n status updates, as it seems to be the best place for such documentation I know of
@joescii
Copy link
Contributor Author

joescii commented Jan 25, 2016

Ah, travis failure. Looks like I've been too loose with teh JavaScriptz

@joescii
Copy link
Contributor Author

joescii commented Jan 25, 2016

Any ideas why we're failing to boot in the travis script? I wouldn't have expected a JS enhancement to cause that... :-/

@eltimn
Copy link
Member

eltimn commented Jan 25, 2016

"src/main/resources/toserve/lift.js: line 110, col 24, Possible strict violation"

It looks like it doesn't like the use of this on line 110. This SO article explains it.

If we just assign the function to a variable var notifyAll = function instead of function notifyAll then the error goes away. I'm not sure if that's the best solution or not, but, I updated your branch locally with that change. I'll push that now.

@joescii
Copy link
Contributor Author

joescii commented Jan 25, 2016

Awesome, thanks for the help Tim. I guess I missed the second jshint complaint when I saw the fail to boot stacktrace.

We could make that function call less fancy now. When I first started it, I thought I wouldn't know the number of parameters. Now that it's worked out, we know it's either 1 or 2 args.

@joescii
Copy link
Contributor Author

joescii commented Jan 27, 2016

Nullifying this PR per @Shadowfiend's recognition that any Lift user can already accomplish the same effect by configuring settings.ajaxPost and settings.ajaxGet to be notified of failure or success of ajax and comet communication respectively.

@joescii joescii closed this Jan 27, 2016
@farmdawgnation farmdawgnation deleted the server-comm-failure-callbacks branch September 2, 2024 13:44
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.

2 participants