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

Appview blocks #1187

Merged
merged 60 commits into from
Jun 12, 2023
Merged

Appview blocks #1187

merged 60 commits into from
Jun 12, 2023

Conversation

dholms
Copy link
Collaborator

@dholms dholms commented Jun 9, 2023

Implements blocks on the appview

@dholms dholms marked this pull request as draft June 9, 2023 19:21
Comment on lines +78 to +83
async processAll(timeout?: number) {
await this.pds.ctx.backgroundQueue.processAll()
if (!this.bsky) return
await this.processFullSubscription(timeout)
await this.bsky.ctx.backgroundQueue.processAll()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yupyup, been wanting to do exactly this 💪

@dholms dholms marked this pull request as ready for review June 9, 2023 20:13
Base automatically changed from appview-mutes to main June 10, 2023 21:12
Comment on lines 466 to 476
function truncateUtf8(str: string | null | undefined, length: number) {
if (!str) return str
const encoder = new TextEncoder()
const utf8 = encoder.encode(str)
if (utf8.length > length) {
const decoder = new TextDecoder('utf-8', { fatal: false })
const truncated = utf8.slice(0, length)
return decoder.decode(truncated).replace(/\uFFFD$/, '')
}
return str
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can get rid of this now that all clients are compatible with the lex refactor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah cool cool checks out 👍

i couldn't quite remember when we'd added this in & erred on the side of caution

@@ -54,6 +56,7 @@ export class IndexingService {
profile: Profile.makePlugin(this.db, backgroundQueue),
list: List.makePlugin(this.db, backgroundQueue),
listItem: ListItem.makePlugin(this.db, backgroundQueue),
block: Block.makePlugin(this.db, backgroundQueue),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should remove records from the actor_block table during unindexActor() too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yup totally. good call 👍

).toBeFalsy()
})

// it('strips blocked users out of getPopular', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this remain commented out intentionally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea removed that method from the appview - i'll just remove this test

Copy link
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

Had a few minor thoughts, but this is looking great 🙏

@dholms dholms merged commit 08fbb33 into main Jun 12, 2023
@dholms dholms deleted the appview-blocks branch June 12, 2023 16:05
mloar pushed a commit to mloar/atproto that referenced this pull request Sep 26, 2023
* Model post and profile aggs in bsky

* Add background, onCommit, db and background stats

* Add aggregations for post and profile

* Use background queue in bsky labeler, misc plumbing

* Process background throughout bsky tests

* bsky tidy and fixes

* Build views using agg tables in bsky

* Views of feedgens on bsky

* hook up indexing

* Setup custom feeds on bsky

* graph service + getList routes

* migration

* Feed views refactor for bsky, implement getFeed w/ auth passthrough

* mute lists

* add getListMutes

* mute list tests

* add mutes table & mute/unmuteActor routes

* Passthrough auth from bsky appview to feedgen, fixes/tidy/tests

* add getMutes

* implement mute functionality

* remove unspecced

* mute tests

* mute impl tests

* remove proxy tests

* Test custom algos on bsky

* add mute state to snapshots

* table & indexing plugin

* getBlocks

* bail out of mute subquery when no viewer

* fleshing out services

* Test pds getFeed proxy

* tidy, fix build

* tidy

* Fix minor race in bsky mutelist tests

* blocks in feed views

* db migration, impl block logic & tests

* Update pds proxy snaps based on appview mutes

* missed some files on last commit

* ensure process after unmute

* update snap

* move adminAuth to seedclient param

* apply blocks in getFeed

* update snaps

* upadate one last snap

* pr feedback

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
mloar pushed a commit to mloar/atproto that referenced this pull request Nov 15, 2023
* Model post and profile aggs in bsky

* Add background, onCommit, db and background stats

* Add aggregations for post and profile

* Use background queue in bsky labeler, misc plumbing

* Process background throughout bsky tests

* bsky tidy and fixes

* Build views using agg tables in bsky

* Views of feedgens on bsky

* hook up indexing

* Setup custom feeds on bsky

* graph service + getList routes

* migration

* Feed views refactor for bsky, implement getFeed w/ auth passthrough

* mute lists

* add getListMutes

* mute list tests

* add mutes table & mute/unmuteActor routes

* Passthrough auth from bsky appview to feedgen, fixes/tidy/tests

* add getMutes

* implement mute functionality

* remove unspecced

* mute tests

* mute impl tests

* remove proxy tests

* Test custom algos on bsky

* add mute state to snapshots

* table & indexing plugin

* getBlocks

* bail out of mute subquery when no viewer

* fleshing out services

* Test pds getFeed proxy

* tidy, fix build

* tidy

* Fix minor race in bsky mutelist tests

* blocks in feed views

* db migration, impl block logic & tests

* Update pds proxy snaps based on appview mutes

* missed some files on last commit

* ensure process after unmute

* update snap

* move adminAuth to seedclient param

* apply blocks in getFeed

* update snaps

* upadate one last snap

* pr feedback

---------

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants