When an action is sent over the wire, we should add the aquedux key to it and it should contains the following keys:
{
token: localStorage.getItem('aquedux-jwt'),
}
When we receive an action from the server it should have the following keys:
{
token,
server: {
enterTimestamp: number,
leaveTimestamp: number
},
}
The user-side timestamps are useless tho because they would be only valid for the action sender to compute the action roundtrip is needed:
totalDuration = client.receiveTimestamp - client.sendTimestamp;
serverDuration = server.leaveTimestamp - server.enterTimestamp;
roundtripDuration = (totalDuration - serverDuration) / 2
When an action is sent over the wire, we should add the
aqueduxkey to it and it should contains the following keys:When we receive an action from the server it should have the following keys:
The user-side timestamps are useless tho because they would be only valid for the action sender to compute the action roundtrip is needed: