-
Notifications
You must be signed in to change notification settings - Fork 370
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
Candy should be able to reconnect on its own after temporary loss of network connection #202
Comments
We certainly could display the login form again. Saving user/pw combination is not a good option IMO (which would enable Candy to reconnect on it's own).. What do you think? |
I implemented XMPP prebinding last night with the help of your PHP class. Now the login form appears better after loss of connection. I'm using Basic Auth to prefill l/p over HTTPS, with some modifications to index.php. I think we have two scenarios here for this issue: prebinding and non-prebinding. Prebinding:
Non-prebinding:
|
Regarding the specific usecase as described in #210, I guess we could help you if we trigger an event (then you could run |
Yep, callback sounds nice |
There's an event |
You said that "disconnected" is shown. Are you sure it's "disconnected" and not "disconnecting"? |
Nevertheless, what you can do is the following to alter Candy's default behaviour: $(Candy).on('candy:core.chat.connection', function(args) {
switch(args.status) {
case Strophe.Status.DISCONNECTED:
case Strophe.Status.ERROR:
case Strophe.Status.CONNFAIL:
window.location.reload();
}
} Would this solve the issue for you? |
Hmm, I actually wrote "Disconnect" with no suffix. I'm pretty sure it was "Disconnecting...", but I'll double-check it later. Right now this works beautifully: diff --git a/candy.bundle.js b/candy.bundle.js
index f255e10..1083ff4 100644
--- a/candy.bundle.js
+++ b/candy.bundle.js
@@ -2649,8 +2649,7 @@ Candy.View.Observer = (function(self, $) {
break;
case Strophe.Status.DISCONNECTED:
- var presetJid = Candy.Core.isAnonymousConnection() ? Strophe.getDomainFromJid(Candy.Core.getUser().getJid()) : null;
- Candy.View.Pane.Chat.Modal.showLoginForm($.i18n._('statusDisconnected'), presetJid);
+ location.reload();
break;
case Strophe.Status.AUTHFAIL: |
Ok, I see. Will try that out. |
I think pluginizing this functionality would be reasonable. If there's events I can hook into, I'll take the burdain of pluginizing it. |
Enable users of Candy to specify if/what happens with the View before the connection status changes using an event per connection status as defined in Strophe.Status.
How about this (example code how you could achieve it included). |
Looks lovely to me :) thanks a bunch. It's going to take a few days for me to set it up on my instance, if you want to hold off for some testing before merging. |
I'm unsure currently whether it should go with the 1.6.0 release or with 1.6.1. @pstadler, what do you think? I think we could add it to the 1.6.0 release, because otherwise we might need to release a new version soon afterwards. |
Whatever you want. I'd rather release a bit more often as long as the overhead is managable. If you feel comfortable to release this with 1.6 (and I think we should do it) then please merge it in. |
Released beta3 with this fix included. Thanks! |
Thanks a lot. Side note: I wonder if restoring the "last active tab" state on reconnect deserves a separate issue. Otherwise reconnect throws the user to the mercy of autojoin order. |
Hi @lkraav @mweibel sorry for the silly question, i'm trying to use prebinding (when i use the normal Candy.Core.connect method everything works perfectly) and when i use Candy.Core.attach the status is logged, but i'm not sure how i can trigger the display of the Chat Room Pane. What is the proper way to update the view when using attach()? I debugged and found that when i use Candy.Core.attach the following lines are not called compared to Candy.Core.connect.
|
@caherrerapa I really don't have enough know-how to answer your q |
What's the reason not to allow storage of credentials in local user RAM? Most clients do this, and it would allow actual reconnection without user interaction. Maybe as a plugin? |
Right now endless "Disconnect" overlay with spinner is displayed, until URL is manually reloaded. I imagine this can be improved?
The text was updated successfully, but these errors were encountered: