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

allow for initial id in repo create #388

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

BrianHung
Copy link

@BrianHung BrianHung commented Sep 24, 2024

Allows for specified id in repo.create.

One thing: in the conversation about pre-defined ids and about loading from binary, does automerge.from clone the document that is passed in?

I'm wondering if this allows for the following:

const copy = {
  content: new Uint8Array([133, 111, 74, 131, ...]),
  id: ...
}

const doc = am.load(copy.content)
const handle = repo.create(doc, copy.id)

so that the initial value in repo.create shares ancestry with the binary that is passed in.

@adrianduke
Copy link

Nudge for this functionality! I was just about to write this PR before I saw this... Can provide a hand if needed.

@BrianHung
Copy link
Author

Feel free to jump into this discord thread: https://discord.com/channels/1200006940210757672/1287965416689238047/1288223592936374323 The main blocker is how should we handle conflicting ids.

@adrianduke
Copy link

I don't appear to be able to access from that link, I'm not currently apart of the discord either so that might be why!

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.

3 participants