Skip to content

Commit

Permalink
SMC-4466: fixed light client response subscription path, fixed creati…
Browse files Browse the repository at this point in the history
…on options
  • Loading branch information
southbite committed Dec 2, 2021
1 parent e8520c1 commit 7c9a79e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20,930 deletions.
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,8 @@
- happn-3 upgrade:
- feature: SMC-734: Updated happn-util-crypto - removed bitcore, changes to crypto calls, removed payload encryption
- test: fixed browser test validation

11.6.1 2021-12-02
-----------------
- fix: SMC-4466 - light client times out for secure requests

6 changes: 3 additions & 3 deletions lib/providers/connection-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@

if (typeof connections === 'function') {
callback = connections;
options = {};
options = null;
connections = null;
}

if (typeof options === 'function') {
callback = options;
options = {};
options = null;
}

return Happn.client.create(connections, options, function(e, client) {
Expand Down Expand Up @@ -76,8 +76,8 @@
_this.happnerClient.emit('reconnecting', opts);
});

_this.happnerClient.emit('connected');
_this.connected = true;
_this.happnerClient.emit('connected');
_this.bubbleConnectedToClient(callback);
});
};
Expand Down
11 changes: 9 additions & 2 deletions lib/providers/light-implementors-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

this.name = opts.name || opts.domain;
this.domain = opts.domain || opts.name;
this.sessionId = undefined;
this.secure = opts.secure;
this.sessionId = undefined; // this.connection.client.session.id;
this.secure = false; // this.connection.client.session.happn.secure;

this.reconnectedHandler = undefined;
this.addPeerHandler = undefined;
Expand All @@ -29,12 +29,19 @@
// pending list of descriptions we're waiting for
// this.awaitingDescriptions = {};
happnerClient.on('reconnected', (this.reconnectedHandler = this.reconnected.bind(this)));
happnerClient.on('connected', (this.connected = this.connected.bind(this)));
}

LightImplementorsProvider.prototype.clear = function() {
this.maps = {};
};

LightImplementorsProvider.prototype.connected = function() {
this.clear();
this.sessionId = this.connection.client.session.id;
this.secure = this.connection.client.session.happn.secure;
};

LightImplementorsProvider.prototype.reconnected = function() {
this.clear();
this.sessionId = this.connection.client.session.id;
Expand Down
Loading

0 comments on commit 7c9a79e

Please sign in to comment.