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

backfill: use constants for bufferedOp.kind #641

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

mrd0ll4r
Copy link
Contributor

@mrd0ll4r mrd0ll4r commented Apr 9, 2024

(Part of #638)

This utilizes constants from the repomgr package for buffered operations.
This was already the case, actually, as they were used here, I just added them throughout the code.

They're also used to check the operations emitted by the firehose: https://github.com/bluesky-social/indigo/blob/main/backfill/backfill.go#L469-L471
The firehose, in turn, uses the events emitted by the repo manager for the Action field in firehose events: https://github.com/bluesky-social/indigo/blob/main/indexer/indexer.go#L83-L94
This brings us full circle:
Repo manager emits diff operations -> firehose repo commit ops .Action -> backfill buffered op .kind

Notably, the constants are also given in the lexicon: https://github.com/bluesky-social/atproto/blob/main/lexicons/com/atproto/sync/subscribeRepos.json#L178
But lexgen does not generate constants for them.

The test in backfill_test.go is broken, but I changed the constants anyway.

Copy link
Collaborator

@ericvolp12 ericvolp12 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

@ericvolp12 ericvolp12 merged commit 094423f into bluesky-social:main Apr 16, 2024
2 checks passed
@mrd0ll4r mrd0ll4r deleted the backfill_constants branch April 16, 2024 09: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.

2 participants