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

Export the LoadSyncMessage function #31

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

astromechza
Copy link
Contributor

@astromechza astromechza commented Oct 26, 2024

TL;DR: this change makes an existing loadSyncMessage function public by capitalising it.

I'd like to have access to the LoadSyncMessage function so that I can inspect a received message before merging it into the document. This would allow me to do things like:

  1. Accept only empty sync messages and reject those with changes
  2. Inspecting the actor id and message of a change within the sync message and rejecting or verifying based on the information

Right now I can only achieve this by accepting the change, checking it, and then forking the document based on the previous heads in order to "rollback" which is obviously more expensive than I'd like.

Thanks!

@astromechza
Copy link
Contributor Author

cc @ConradIrwin

@astromechza
Copy link
Contributor Author

Build failed on 1 runner due to a panic in the static linter 🤣 https://github.com/automerge/automerge-go/actions/runs/11534888217/job/32194058725?pr=31

@ConradIrwin ConradIrwin merged commit 6fb4f2d into automerge:main Oct 30, 2024
3 of 5 checks passed
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.

2 participants