Skip to content
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

Data remained in firebase. #19

Open
zhuhan1236 opened this issue Apr 26, 2013 · 3 comments
Open

Data remained in firebase. #19

zhuhan1236 opened this issue Apr 26, 2013 · 3 comments

Comments

@zhuhan1236
Copy link

Thank you a lot for your help!

I tried the latest version "RTCMultiConnection_1.2" yesterday with the given demo "user-ejection" using my own firebase site.

I found that there is data remained in my firebase after connection even though the web pages are closed (The remained data is user id varying from 0~9999 giving below).
image
And the "audio-conference" mode in the earlier version "RTCMultiConnection_1.1" doesn't have this problem.

I read the code of "RTCMultiConnection_1.2" and find that the method "socket.onDisconnect().remove()" isn't attached to every firebase socket but only the initiator's socket.

    self.open = function (_channel, extra) {
        ......

        if(self.socket) self.socket.onDisconnect().remove();
    };

I think that the above function means that only the initiator's quit will delete it's data in firebase. It causes the data remaining problem. But if I attach "onDisconnect().remove()" method to every firebase connection in the function "openSignalingChannel", just as what the version 1.1 did, then any member's quit will remove the whole room data in firebase.

Would you please tell me whether I can fix this problem?

Sorry for my poor English.

@muaz-khan
Copy link
Owner

We are already discussing this issue since last week. Many workarounds has been tested. Next version of RTCMultiConnection-v1.3.js will auto recover firebase server stuff for each user.

@zhuhan1236
Copy link
Author

OK, waiting for your exciting work!

And for the code below:

    var connection = new RTCMultiConnection('users-ejection-and-presence-detection');
    var sessionsList = document.getElementById('sessions-list');
    connection.onNewSession = function (session) {
    ......
    }

I think it's possible that the function "onNewSession()" be called before it had been overwriten. That makes the existing session invisible for the new user. It happened in my own site when I write like that(I opened the firebase socket and read data from it before the line "var connection = new RTCMultiConnection('user-ejection-and-presence-detection');".

@muaz-khan
Copy link
Owner

I'm doing major updates in both DataChannel.js and RTCMultiConnection.js (next week).

var defaults = RTCMultiConnection.Defaults;
defaults.session = 'one-to-many';
defaults.onNewSession = function(session) {}

RTCMultiConnection.Signaler.openSignalingChannel = function(config) { };

var connection = new RTCMultiConnection('session-id');
connection.reconnect(); // re-initialize the entire session

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

No branches or pull requests

2 participants