Skip to content

Commit

Permalink
fix test server response
Browse files Browse the repository at this point in the history
format server
  • Loading branch information
caalador committed Jan 9, 2025
1 parent b55aceb commit 7a97b9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ private void sendPayload(final JsonObject payload) {
payload.put(ApplicationConstants.CLIENT_TO_SERVER_ID,
clientToServerMessageId++);

if (!registry.getRequestResponseTracker().hasActiveRequest()) {
// Direct calls to send from outside probably have not started
// request.
registry.getRequestResponseTracker().startRequest();
}

if (push != null && push.isBidirectional()) {
// When using bidirectional transport, the payload is not resent
// to the server during reconnection attempts.
Expand Down
2 changes: 1 addition & 1 deletion flow-client/src/test/frontend/FlowTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ function stubServerRemoteFunction(
handlers.leaveNavigation();
}
}
req.respond(200, { 'content-type': 'application/json' }, 'for(;;);[{}]');
req.respond(200, {'content-type': 'application/json'}, 'for(;;);[{"syncId":' + (payload["syncId"] + 1) + ',"clientId":' + (payload["clientId"] + 1) + '}]');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ public RpcRequest(String jsonString, boolean isSyncIdCheckEnabled) {
clientToServerMessageId = (int) json
.getNumber(ApplicationConstants.CLIENT_TO_SERVER_ID);
} else {
if(!isUnloadBeaconRequest()) {
getLogger().warn(
"Server message without client id received");
if (!isUnloadBeaconRequest()) {
getLogger()
.warn("Server message without client id received");
}
clientToServerMessageId = -1;
}
Expand Down

0 comments on commit 7a97b9a

Please sign in to comment.