2251 Commits

Author SHA1 Message Date
devin ivy
6b3d5c133e
Misc notification and suggestion optimizations (#920)
* Background notification creation/deletion

* Add todo

* Update tests for backgrounded notifs

* Add index to notifications supporting record deletion

* Use profile_agg to power getSuggestions

* Fetch record blocks separately from getting notification resultset

* Update background queue to drain pending tasks
2023-04-27 19:10:21 -04:00
devin ivy
da6ee3908a
Background notification creation and deletion (#919)
* Background notification creation/deletion

* Add todo

* Update tests for backgrounded notifs

* Undo backgrounding of notification creation

* Revert "Undo backgrounding of notification creation"

This reverts commit 507353a9802da75a232fc245ede30d47dab74e5f.
2023-04-27 17:12:18 -04:00
devin ivy
5249e52f36
Lengthen pass reset and invite codes (#912)
* Lengthen pass reset and invite codes, invalidation on reset

* Tidy

* Adjust token format for reset and deletion

* Update invite codes to use same token gen as pass reset and acct deletion
2023-04-27 14:26:31 -04:00
devin ivy
7d1243f53a
Limit concurrency of pds background tasks (#917) 2023-04-27 14:07:46 -04:00
Daniel Holmgren
384e739a3b
Allow admins to update handles to reserved handles (#916)
* allow admins to update handles to reserved handles

* tidy
2023-04-27 12:02:47 -05:00
devin ivy
4b70b80bd0
Log db and background queue stats (#908)
* Log db stats

* Log background queue stats
2023-04-26 19:09:24 -04:00
Daniel Holmgren
df7cbae4f2
Lower seq ranges on sequencer backfill (#907)
lower seq ranges on sequencer backfill
2023-04-26 18:24:37 -04:00
Paul Frazee
d2f1207b20
Publish @atproto/api@0.2.10 (#905)
@atproto/api@0.2.10
2023-04-26 15:46:46 -05:00
Paul Frazee
480a186c57 Merge branch 'thinkverse-add-shortcuts-to-bskyagent' into main 2023-04-26 15:44:41 -05:00
Paul Frazee
1656f6c5a8 Apply code formatting 2023-04-26 15:44:24 -05:00
Paul Frazee
23cf788216 Merge branch 'add-shortcuts-to-bskyagent' of https://github.com/thinkverse/atproto into thinkverse-add-shortcuts-to-bskyagent 2023-04-26 15:41:59 -05:00
Daniel Holmgren
ece4b61d50
Fix typo in appview (#899)
fix typo
2023-04-25 19:24:23 -05:00
devin ivy
e2d256404c
Finalize support for new moderation report reasons (#896) 2023-04-25 19:12:29 -05:00
Daniel Holmgren
4b7f7a5294
Appview proxying bugfixes (#897)
* fix some bugs in proxying reqs to appview

* update snap
2023-04-25 17:24:46 -05:00
Devin Ivy
01501f0d49 Fix snapshots 2023-04-25 17:33:29 -04:00
devin ivy
eb7667e4fc
Add labels onto record embeds (#854)
* Add lexicons for labeling embeds

* Hydrate labels onto record embeds in pds

* Support labels on embeds in bsky appview
2023-04-25 17:19:40 -04:00
Daniel Holmgren
68004c617f
Appview proxy (#827)
* fix up a couple of tsc errors in app view merge

* wip

* simple proxy

* use dev-env for appview tests

* process all in blob resolver

* another test fix

* wip

* copy proxied tests & add mutes to getFollows/getFollowers

* tidy & add mutes to likes

* more routes + getAuthorFeed tests

* more testing

* tests for feed views

* thread testing

* finished tests for threads

* temporarily skip some tests

* cleaning up & updating test names

* separate db schema for appview

* rearrange

* typo

* add notifications

* re-enable notifs on pds appview

* update schemas

* updated some bsky snaps

* wip

* refactor did-resolver

* clean up deps

* some fixups + caching utilities

* fix up & move to appCtx

* neat its working

* update bsky tests to new auth

* rm unused pds config var

* tidy

* check exp in seconds

* cache dids in postgres

* add migration & did-cache

* start tests

* couple helpers around cache invalidation

* fix expired check

* wip

* change cache semantics

* did cache testing

* do some cache revalidation in indexing

* fix config

* fix issue w did-resolver test-env prototype

* use map instead of record

* stale + expired

* tests

* clear entry method

* fix up build

* expired dids

* clear missing dids

* better verify payload

* bump test timeout

* fix notifs test

* fix up proxied actor search tests

* update snaps to include labels

* fix dev env

* fix up moderation route auth

* fix more auth headers

* fix auth on getPosts

* increase jest timeouts

* fix snaps
2023-04-25 15:26:14 -05:00
Daniel Holmgren
cae6779916
Fix leaky database transactions (#890)
* fix leaky txs

* tidy

* end tx in finally
2023-04-25 10:51:59 -05:00
Devin Ivy
a8fa9b2b14 Merge remote-tracking branch 'origin/bsky-app-view' 2023-04-25 11:08:26 -04:00
bnewbold
af9f11fbde
'bsky' (appview) dev helpers (#888)
* remove commited .env files; exclude in gitignore

* bsky: distinct postgresql database in dev mode

* github CI: build and upload 'bsky' container to GHCR

This isn't how we deploy, but is useful for public access and things
like integration tests.

* Makefile: run-dev-appview
2023-04-24 16:27:34 -07:00
Kim Hallberg
8256df303f
Add getPosts shortcut 2023-04-25 00:29:13 +02:00
Kim Hallberg
3852b857d5
Add getSuggestions shortcut 2023-04-25 00:27:15 +02:00
Devin Ivy
0cc211b98a Fix appview dockerfile 2023-04-24 18:07:09 -04:00
Paul Frazee
02dcf7d891
@atproto/api@0.2.9 (#886) 2023-04-24 16:37:58 -05:00
dholms
b4dc8ab2b4 make sure we dont accept non-empty string 2023-04-24 14:22:41 -05:00
bnewbold
5137b427de
add BR and JP specific handles to reserved list (#878)
Co-authored-by: dholms <dtholmgren@gmail.com>
2023-04-24 12:39:35 -05:00
devin ivy
b7210bf0a1
Fix strict_word_similarity_threshold configuration (#880)
* In-progress work on optimizing actor search

* Tidy-up approach to using trgm index on actor search, apply to bsky appview

* Set trigram on session rather than on db via migration
2023-04-24 13:18:08 -04:00
devin ivy
0c02804a73
Ensure indexes are used on actor search queries (#879)
* In-progress work on optimizing actor search

* Tidy-up approach to using trgm index on actor search, apply to bsky appview

* Fix comment typo
2023-04-24 11:17:30 -04:00
Daniel Holmgren
a360cc6004
Chunk getRepo query (#877)
chunk get repo query
2023-04-24 10:09:19 -05:00
Devin Ivy
92995859dc Fix bsky getPosts 2023-04-24 09:03:39 -04:00
Daniel Holmgren
553f59923c
Get posts method (#876)
* implement getPosts method

* tests

* bsky tests

* comment out test

* Handle stripping record-with-media viewer info in bsky tests

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
2023-04-23 23:43:37 -05:00
devin ivy
47890d65b9
Add labeler functionality to the appview (#851)
* Add moderation and labeling model to bsky appview

* Carry over moderation service from pds

* Pass over bsky moderation service to get it working, missing blob support

* Carry over label service from pds to bsky

* Reorg bsky http auth, implement admin auth

* Carry over relevant admin endpoints pds to bsky

* Retrofit bsky admin routes from pds impls

* Implement resolve handle on appview

* Avoid loop in bsky handle resolution

* Add bsky appview to dev-env, opt-in

* Fix bsky searchRepos with empty term, tidy

* Include blobs on bsky admin views

* Stop resolving taken-down blobs on appview

* Tidy

* Carry over pds moderation tests to bsky

* Support image cache invalidation on bsky appview

* Add missing changes for bsky tests

* Test takedowns in bsky views

* Test takedowns on bsky notifs

* Separate blob resolution logic into standalone helper

* Carry over labeler from pds to bsky

* Update labelers for bsky usage

* Configure labeler on appview, tidy blob-resolver

* Add labels to views for posts and actors

* Update snapshots on bsky appview to include labels

* Carry over labeler tests from pds to bsky

* Tidy-up labeler tests for bsky appview

* Update bsky seeds and snapshots for keyword labeling

* Tidy

* In bsky appview ensure label.neg is modeled as a boolean, not an integer bit. Add select column when checking blob takedown.

* Include labels on appview listNotifications, fix blob resolver content-type, tidy
2023-04-23 23:58:10 -04:00
devin ivy
05e6ebed63
Bsky appview admin and moderation endpoints (#840)
* Add moderation and labeling model to bsky appview

* Carry over moderation service from pds

* Pass over bsky moderation service to get it working, missing blob support

* Carry over label service from pds to bsky

* Reorg bsky http auth, implement admin auth

* Carry over relevant admin endpoints pds to bsky

* Retrofit bsky admin routes from pds impls

* Implement resolve handle on appview

* Avoid loop in bsky handle resolution

* Add bsky appview to dev-env, opt-in

* Fix bsky searchRepos with empty term, tidy

* Include blobs on bsky admin views

* Stop resolving taken-down blobs on appview

* Tidy

* Carry over pds moderation tests to bsky

* Support image cache invalidation on bsky appview

* Add missing changes for bsky tests

* Test takedowns in bsky views

* Test takedowns on bsky notifs

* In bsky appview ensure label.neg is modeled as a boolean, not an integer bit. Add select column when checking blob takedown.
2023-04-23 23:43:08 -04:00
Daniel Holmgren
f30887bc1c
Clean up Did-resolver (#842)
* refactor did-resolver

* clean up deps

* some fixups + caching utilities

* couple helpers around cache invalidation

* fix expired check

* change cache semantics

* use map instead of record

* stale + expired

* tests

* clear entry method

* clear missing dids

* add missing type
2023-04-23 13:36:01 -05:00
bnewbold
6ebf810a48
minor Makefile tweak: run-dev-pds, not run-pds (#875)
Makefile: run-dev-pds, not run-pds
2023-04-23 12:31:57 -05:00
Daniel Holmgren
01578bc5eb
Better handle races in createAccount (#868)
* better handle races in create account

* better locking

* cleanup

* tidy comment
2023-04-23 12:31:25 -05:00
Daniel Holmgren
2b5347b534
Remove profile labels (#866)
* moderation tweks

* fix: typo. (#818)

* Create invite codes for many accounts (#825)

* create invite codes for many accounts

* test

* Revamp dev env (#796)

* fix up a couple of tsc errors in app view merge

* wip

* use dev-env for appview tests

* process all in blob resolver

* another test fix

* fixed missed merge conflict

* fix one more merge conflict

* fix popular test

* Sync test env with labeler changes (#836)

fix test-env

* Remove extraneous info on getRecord (#835)

* remove extraneous info on getRecord

* fix test-env

* Fix duplication of constants in the crypto package (#819)

* App passwords (#826)

* app password lex & auth chnages

* scrypt things

* implemented app password refresh tokens

* db tidy & migration

* revocation + bugfixin

* tests, listing passwords & cleanup

* Update packages/pds/src/db/scrypt.ts

Co-authored-by: devin ivy <devinivy@gmail.com>

* Update packages/pds/src/db/scrypt.ts

Co-authored-by: devin ivy <devinivy@gmail.com>

* pr feedback

---------

Co-authored-by: devin ivy <devinivy@gmail.com>

* remove profile labels

* rm temp branch from workflow

---------

Co-authored-by: Devin Ivy <devinivy@gmail.com>
Co-authored-by: S. Ota <1632335+susumuota@users.noreply.github.com>
Co-authored-by: Ilya Siamionau <ilya@marshal.dev>
2023-04-23 12:18:24 -05:00
devin ivy
d86cf03cd8
More forgiving config for empty db schema (#871)
* Add more config for pds db pool

* More forgiving handling of empty db schema config
2023-04-22 14:26:31 -04:00
devin ivy
92322af49a
Add more config for pds db pool (#867) 2023-04-21 22:13:41 -04:00
devin ivy
a832c54de7
PDS moderator credentials (#863)
* Setup config and auth verifiers for moderators

* Enforce admin vs. moderator access on PDS admin/server endpoints

* Tidy
2023-04-21 20:58:34 -04:00
Paul Frazee
5b4f506150
Bump @atproto/api@0.2.8 (#865) 2023-04-21 19:12:28 -05:00
Daniel Holmgren
89109ef32d
Format commits outside of tx (#860)
* format commits outside of tx

* fix tests

* fix bsky test

* use persistent cache

* reuse repo storage between attempts to get caching benefits

* better error handling

* tests

* rm failing sqlite test

* pr feedback
2023-04-21 18:13:04 -05:00
Daniel Holmgren
4f1ad109af
Increase getPopular likes to 8 (#862)
* increase get popular likes to 8

* use new like counts agg
2023-04-21 18:12:44 -05:00
Paul Frazee
5b0c2d7dd5 Rename CONTRIBUTERS.md to CONTRIBUTORS.md 2023-04-21 11:26:03 -05:00
devin ivy
a0f0301241
Serve materialized post and profile aggregations (#859)
* Add migration for post & profile aggs to pds

* Post/profile agg db tweaks

* Post/profile aggregation queries on pds

* Add facility for performing work on db commit in pds

* Add background queue to pds

* Perform aggregations during indexing on background queue

* Tidy pds background queue, incorporate into labeler

* Fix pds onCommit, remove unused indexing dep, fix zeros for aggs

* Finish background tasks for view tests in pds

* Update aggregations on account deletion, tidy

* Update profile and post views to serve materialized aggregations
2023-04-21 12:01:23 -04:00
Paul Frazee
7679b2ea71
Create CONTRIBUTERS.md (#861)
* Create CONTRIBUTERS.md

* Update CONTRIBUTERS.md
2023-04-21 10:54:34 -05:00
devin ivy
587b24352d
Materialize post and profile aggregations on write (#858)
* Add migration for post & profile aggs to pds

* Post/profile agg db tweaks

* Post/profile aggregation queries on pds

* Add facility for performing work on db commit in pds

* Add background queue to pds

* Perform aggregations during indexing on background queue

* Tidy pds background queue, incorporate into labeler

* Fix pds onCommit, remove unused indexing dep, fix zeros for aggs

* Finish background tasks for view tests in pds

* Update aggregations on account deletion, tidy
2023-04-21 11:52:45 -04:00
Alice
a5016eba20
Fix README for api (#850)
=>
2023-04-20 12:57:46 -05:00
Daniel Holmgren
24f7183896
Improve streaming sync routes (#848)
* improve streaming sync routes

* pr feedback
2023-04-20 10:26:55 -05:00
Daniel Holmgren
9a8d7529a3
Skip locked repos instead of waiting for lock (#847)
* skip locked repos instead of waiting for lock

* some tests

* rm racing tests on profile

* subscribe repos test
2023-04-19 21:57:06 -05:00