forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detached QPs and hidden replies (bluesky-social#2675)
* 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 (bluesky-social#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 <[email protected]> * Update packages/bsky/tests/seed/postgates.ts Co-authored-by: devin ivy <[email protected]> * Another structuredClone * Update packages/bsky/src/hydration/hydrator.ts Co-authored-by: devin ivy <[email protected]> * Better comment * Update packages/bsky/src/data-plane/server/indexing/plugins/post.ts Co-authored-by: devin ivy <[email protected]> * Regen protos to match dataplane * Update quotes snap to include embeddingDisabled * Clarify usage of post uri -> gate utils --------- Co-authored-by: devin ivy <[email protected]>
- Loading branch information
1 parent
2a0c088
commit aba664f
Showing
75 changed files
with
2,297 additions
and
113 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@atproto/bsky": patch | ||
"@atproto/api": patch | ||
"@atproto/pds": patch | ||
--- | ||
|
||
Adds `postgate` records to power quote gating and detached quote posts, plus `hiddenReplies` to the `threadgate` record. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.feed.postgate", | ||
"defs": { | ||
"main": { | ||
"type": "record", | ||
"key": "tid", | ||
"description": "Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.", | ||
"record": { | ||
"type": "object", | ||
"required": ["post", "createdAt"], | ||
"properties": { | ||
"createdAt": { "type": "string", "format": "datetime" }, | ||
"post": { | ||
"type": "string", | ||
"format": "at-uri", | ||
"description": "Reference (AT-URI) to the post record." | ||
}, | ||
"detachedEmbeddingUris": { | ||
"type": "array", | ||
"maxLength": 50, | ||
"items": { | ||
"type": "string", | ||
"format": "at-uri" | ||
}, | ||
"description": "List of AT-URIs embedding this post that the author has detached from." | ||
}, | ||
"embeddingRules": { | ||
"type": "array", | ||
"maxLength": 5, | ||
"items": { | ||
"type": "union", | ||
"refs": ["#disableRule"] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"disableRule": { | ||
"type": "object", | ||
"description": "Disables embedding of this post.", | ||
"properties": {} | ||
} | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.