Skip to content

Handle an aquedux-specific key in all actions #37

Description

@nicobarray

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    aquedux-clientAny aquedux-client ONLY related issueaquedux-serverAny aquedux-server ONLY related issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions