Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request the latest clock when signing actions #8780

Conversation

rjwebb
Copy link
Collaborator

@rjwebb rjwebb commented Aug 7, 2024

Note that this PR is just to merge into #8537 - I've just put it in a separate PR to make it more convenient to discuss with @raykyri

Description of Changes

This PR populates the clock and parents fields when the session message (Message<Session>) and action message (Message<Action>) are created. It adds a new endpoint /getCanvasClock which returns the current clock and message head ids. This is called from the sign function in /packages/commonwealth/client/scripts/controllers/server/sessions.ts.

TODO:

  • Currently we create a Message<Session> object every time a verified action takes place. In theory we should be able to only create one of these, when the user authorises a new session (this happens when the user logs in or when they revalidate a session).

Test Plan

Tested by logging in and performing actions

@rjwebb rjwebb closed this Aug 12, 2024
@rjwebb rjwebb deleted the rjwebb/canvas-0-10-get-clock branch August 12, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant