[
https://issues.apache.org/jira/browse/THRIFT-4437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16304483#comment-16304483
]
ASF GitHub Bot commented on THRIFT-4437:
----------------------------------------
GitHub user bananer opened a pull request:
https://github.com/apache/thrift/pull/1450
THRIFT-4437: JavaScript WebSocket - fix duplicate callbacks
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bananer/thrift THRIFT-4437
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1450.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1450
----
commit 528b3d90434b8f0217bb5a5922de85483daf5304
Author: Philip Frank <ich@...>
Date: 2017-12-27T11:54:28Z
THRIFT-4437: JavaScript WebSocket - fix duplicate callbacks
----
> JS WebSocket client callbacks invoked twice on parallel requests
> ----------------------------------------------------------------
>
> Key: THRIFT-4437
> URL: https://issues.apache.org/jira/browse/THRIFT-4437
> Project: Thrift
> Issue Type: Bug
> Components: JavaScript - Library
> Affects Versions: 0.11.0
> Reporter: Philip Frank
>
> When using a WebSocket Transport and doing two service calls immediately,
> without waiting for the first to return, e.g. like this:
> {code:javascript}
> const t = new Thrift.TWebSocketTransport('ws://localhost:8338/hello');
> const p = new Thrift.TJSONProtocol(t);
> const client = new HelloSvcClient(p);
> t.open();
> client.test(function (res) {
> console.log(1, res);
> });
> client.test(function (res) {
> console.log(2, res);
> });
> {code}
> The callback to the first invocation is called twice, and the second never,
> i.e. console shows:
> {code}
> 1 "test result"
> 1 "test result"
> {code}
> instead of the expected
> {code}
> 1 "test result"
> 2 "test result"
> {code}
> I suspect this bug was introduced with the patch for
> https://issues.apache.org/jira/browse/THRIFT-4131 where for some reason the
> callback registered twice when set:
> https://github.com/apache/thrift/pull/1372/files
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)