Skip to content

Causal delivery in coln-js-runtime - #131

Open
incipit0 wants to merge 3 commits into
mainfrom
coln-store/causal-delivery
Open

Causal delivery in coln-js-runtime#131
incipit0 wants to merge 3 commits into
mainfrom
coln-store/causal-delivery

Conversation

@incipit0

Copy link
Copy Markdown
Collaborator

@acurrieclark Here is my attempt to replicate your #130 , I have introduced abort, also made all the apply_ function return bytes that have not been applied if they are not ready. Have a go and see if it works for you.

Allow automerge-repo to construct a store from scratch with a chunk of
bytes, assuming they contain the root commit.
Previously when calling `Store::apply_commits`, we assume that all
commits can be applied, and return an error is that is not the case.

As automerge-repo cannot track which commits can be applied, we put this
causal delivery logic in coln-js-runtime temporarily, by keeping what is
returned from apply_chunk_bytes() and keep retrying until success.

coln-js-runtime is not supposed to do this though, and in the long run
we wish to move this logic to somewhere else, perhaps subduction.
@incipit0 incipit0 mentioned this pull request Aug 26, 2026
@acurrieclark

Copy link
Copy Markdown

Thanks so much. I'll get my new sync code rebased onto this and check everything runs as expected.

@acurrieclark

Copy link
Copy Markdown

@incipit0 Tested this today and everything is working as expected with what I need from sync for now, thanks so much.

@incipit0

Copy link
Copy Markdown
Collaborator Author

Ok, I will try to get this merged asap. I might make some force pushes at some point, will let you know if I do that.

//
// SPDX-License-Identifier: Apache-2.0 OR MIT

import { StoreHandle, type TransactionHandle } from "@coln-project/runtime";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvr Can I have your 👀 on this little change? It seems sensible to me, but I wonder if you have opinions on this.

@acurrieclark

Copy link
Copy Markdown

Understood. I'm very happy to just transpose my work directly on top of the new main when this is merged.

Thanks so much

@incipit0
incipit0 marked this pull request as ready for review August 28, 2026 14:56
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