-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add quote gate props to postgate #2693
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pfrazee
approved these changes
Aug 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya lgtm
brianolson
approved these changes
Aug 6, 2024
estrattonbailey
force-pushed
the
quote-gates
branch
from
August 6, 2024 20:02
a196968
to
d66cd64
Compare
estrattonbailey
added a commit
that referenced
this pull request
Aug 21, 2024
* Add new postgate lex, hiddeReplies to threadgate, codegen * Add protobufs * Add to mock dataplane * Add matching postgate method to feed hydration methods * Add to getRecord * Add to HydrationState * Fix typo * Add to mergeStates, fetch embeds in threads * Integrate into embed views * Add test for QPs in threads * Add feed test * Fix naming convention in protos * Add #viewRemoved record view, rename postgate.json * Integrate new view * Filter hidden replies from feeds * Filter out replies at the handler level, do not filter for author feeds * Fix lint * Move hidden reply check to view layer * Reduce, reuse, recycle * Rename to lowercase * Rename layer vars * Add quote gate props to postgate (#2693) * Add quote gate props to postgate * Consistent naming * Fix record structure * Codegen * Show hidden replies in author feed * Allow reposts of hidden replies * Lex and codegen * Add violates_quote_gate to proto * Consistent naming, codegen * Integrate violatesQuotegate and canQuotepost * Remove rules, codegen * Hydrate all postgates for all requested posts * Match other impl * Add test, need to split these out * Format * Hydrate first nested embeds too * Add postgate test suite * Add violatesQuoteGate to dataplane * Ingest and set violatesQuoteGate, return on meta * Return removed embed for quotes that violate gate * Add test * Dedupe URIs before fetching postgates * Update snaps * Snap * Format * Updating naming conventions for postgate-related attributes * Correct naming * Consistency * Proto too * Rename to viewDetached * Codegen * Rename everything * Codegen * Quotes that violate a quote gate can still be quoted themselves * Couple more renames * Snaps * Ensure reply ref is tombstoned for hidden replies * Split out hidden replies tests and create fresh fixture * Hydrate threadgates for reply notifications, filter hidden replies * Remove snap * Add flaky test * Rename violatesEmbeddingRules * Fix flaky test * Only write to db if violatesEmbeddingRules is true * DRY up post uri -> gate uri logic * isThreadgateListRule * Don't share users object between tests * No pascal * Remove default params * Find -> some * canQuotepost -> canEmbed, remove optional * Fix quoteee typo * await follows * Throw in post uri -> gate utils * Ensure fetch threadgates for reply roots * Don't hydrate threadgates twice * DRY up uri -> did parsing * Clean up parsePostgate logic * Format * Revert change * Revert change * Replace a couple more uri->did conversions * Only filter replies from feeds if viewer hid them * Revert, filter out replies that are hidden from feeds * Remove old test * Replace uri->did util * Revert change to unused file * Only validatePostEmbed and check postgates for post records * Ensure notifications aren't generated down a hidden reply chain * Changeset * Cleanup * Fix notification filtering logic * Simplify * Don't notify for invalid embeds * Use new APIs * Add hasPostGate and hasThreadGate flags from dataplane * Only fetch postgates if post has one * Only fetch threadgates if post has one or was deleted * Remove notification filtering * Don't hydrate threadgates for notifications * Move hidden replies in feeds to match block handling * Do no filtering of hidden replies in feeds * Revert "Don't hydrate threadgates for notifications" This reverts commit 1dcec0b. * Revert "Remove notification filtering" This reverts commit 1e7069d. * Filter notifications for OP only * Add additional check to hidden replies test * Move noty filter logic into method handler * Update .changeset/perfect-parrots-appear.md Co-authored-by: devin ivy <devinivy@gmail.com> * Update packages/bsky/tests/seed/postgates.ts Co-authored-by: devin ivy <devinivy@gmail.com> * Another structuredClone * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <devinivy@gmail.com> * Better comment * Update packages/bsky/src/data-plane/server/indexing/plugins/post.ts Co-authored-by: devin ivy <devinivy@gmail.com> * Regen protos to match dataplane * Update quotes snap to include embeddingDisabled * Clarify usage of post uri -> gate utils --------- Co-authored-by: devin ivy <devinivy@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
quotePostRules[]
array to thepostgate
record. It re-uses the rulesets and naming conventions fromthreadgate
. Absence of thequotePostRules
array denotes the default state where everyone is allowed QP the post.It also adds an additional rule called
disableRule
so that the disabled state is explicit, as opposed to inferred via an emptyallow
array onthreadgate
records. This makes it easier to maintain this record, now that they contain multiple properties managed separately.