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

Send prevs on firehose #3449

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

Send prevs on firehose #3449

wants to merge 24 commits into from

Conversation

dholms
Copy link
Collaborator

@dholms dholms commented Jan 23, 2025

Add an experimental field subscribeRepos commit ops which includes the cid of the prev record in the case of updates/deletes.

This is intended for testing of a new sync semantic that allows firehose consumers to do fully authenticated sync without keeping around a repo store.

Note on the implementation: I moved ops into the CommitData because they need a reference to the prev which can only be gotten from the transactional update of the user's repository, not in the "write preparation" step since two writes at the same time will cause one transaction to fail and replay while write preparation happens outside of the transaction.

@dholms dholms marked this pull request as ready for review January 23, 2025 22:17
},
"prev": {
"type": "cid-link",
"description": "EXPERIMENTAL. For deletes and updates, the CID of the previous record. For creates, undefined."
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use a nullable to be able to determine if the implementation supports this or not ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I had the same thought about detecting support. Daniel pointed out that we don't need to worry about that yet for the experimental phase. The tricky part here will be that we want to avoid optional, nullable fields.

Copy link
Collaborator

Choose a reason for hiding this comment

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

just to note, nullable and optional combined is a no-go (for golang), and that is especially relevant for these wire protocol details.

@bnewbold
Copy link
Collaborator

bnewbold commented Feb 2, 2025

to cross-reference, I have a similar set of Lexicon changes proposed in this PR: #3391

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.

4 participants