Commit Graph

944 Commits

Author SHA1 Message Date
Alex Gleason 25db277a9f
storeMiddleware: remove `as string` 2024-04-29 15:10:08 -05:00
Alex Gleason 0925f37929
Make storeMiddleware available in every request 2024-04-29 15:05:08 -05:00
Alex Gleason 1ea5591393
Improve mentions performance 2024-04-28 12:12:58 -05:00
P. Reis 86573a579b refactor: store middleware 2024-04-27 20:59:35 -03:00
P. Reis ab7a60c6de fix(UserStore): add missing return keyword in array filter 2024-04-27 17:04:14 -03:00
P. Reis a7912e0800 feat: if possible use userStore in renderStatuses() 2024-04-27 17:03:30 -03:00
P. Reis 18508d37f2 feat: define userStore in HonoEnv & set userStore middleware in home timeline 2024-04-27 17:02:07 -03:00
P. Reis 7b864482bf feat: create user store middleware 2024-04-27 17:00:03 -03:00
Alex Gleason 606ab58c0a
UserStore.test: use MockRelay 2024-04-26 15:39:28 -05:00
Alex Gleason 7e053fbeea Merge branch 'feat-create-user-store' into 'main'
Create a UserStore class

See merge request soapbox-pub/ditto!184
2024-04-26 20:33:01 +00:00
P. Reis 8a460d6bc5 test: create rough tests for UserStore 2024-04-26 16:23:10 -03:00
P. Reis 2b8ad8c349 Merge branch 'main' into feat-create-user-store 2024-04-26 16:06:10 -03:00
P. Reis c87db6d1f8 refactor: remove muteList as a field 2024-04-26 16:05:53 -03:00
Alex Gleason f61d29eb66
Upgrade Nostrify to v0.15, use MockRelay in tests instead of NCache 2024-04-26 12:33:52 -05:00
Alex Gleason 498e91ee7c
Merge remote-tracking branch 'origin/main' into refactor-subs 2024-04-25 21:27:57 -05:00
Alex Gleason f1700a08f9
InternalRelay: fix event distribution 2024-04-25 21:04:34 -05:00
Alex Gleason b04d0c42e6
Merge remote-tracking branch 'origin/main' into refactor-subs 2024-04-25 19:04:01 -05:00
Alex Gleason 4e4b7711c9
relay: NSchema 2024-04-25 18:48:02 -05:00
Alex Gleason 7ee258fe87
relay: fix local filtering logic 2024-04-25 18:46:34 -05:00
Alex Gleason 333dfca270
Storages: typofix subsub -> pubsub 2024-04-25 18:31:16 -05:00
Alex Gleason 05534d532b
APISigner: refactor with InternalRelay 2024-04-25 18:28:19 -05:00
Alex Gleason 7aa931a69e
try-catch the InternalRelay req's 2024-04-25 18:24:03 -05:00
Alex Gleason 7a18a19b2f
Remove subs.ts & subscription.ts, refactor around it 2024-04-25 18:23:26 -05:00
P. Reis ddc84bf47a refactor(UserStore): change fields to private & handle in case of muteList undefined 2024-04-25 18:43:12 -03:00
Alex Gleason 60ca3652bb
try-catch the InternalRelay req's 2024-04-25 16:36:20 -05:00
P. Reis 6c292b8da4 feat: create UserStore class 2024-04-25 16:41:40 -03:00
Alex Gleason f33ad04084
Remove subs.ts & subscription.ts, refactor around it 2024-04-25 13:18:35 -05:00
Alex Gleason fc47116dd3
APISigner: reimplement with NConnectSigner and InternalRelay 2024-04-25 12:32:39 -05:00
Alex Gleason 8407583d83
Add InternalRelay class 2024-04-25 11:54:25 -05:00
Alex Gleason 677720f15e
Unrestrict media uploads 2024-04-24 19:22:36 -05:00
Alex Gleason 953295c534 server.ts: Conf.localPort -> Conf.port 2024-04-24 16:26:56 +00:00
Siddharth Singh 58b034e169
rename DITTO_LISTEN_ON and localPort() to PORT and port() 2024-04-24 21:38:05 +05:30
Siddharth Singh 3880f1e013
allow configuring the local port ditto listens on 2024-04-24 21:32:02 +05:30
Alex Gleason 1f5ba81e98
hydrateEvents: early return is only needed for stats? 2024-04-23 21:40:02 -05:00
Alex Gleason a2c3daade7
hydrateEvents: return early if the results would be empty 2024-04-23 21:32:48 -05:00
Alex Gleason b8d01ea3de
hydrateEvents: use filters to find events in memory 2024-04-23 21:10:21 -05:00
Alex Gleason a1423bbf65
Fix hydrateEvents, lol 2024-04-23 20:11:07 -05:00
Alex Gleason 191b370c85
hydrate.test: remove unnecessary boilerplate 2024-04-23 19:50:23 -05:00
Alex Gleason 0aab3eb775
Rewrite hydrateEvents 2024-04-23 19:31:48 -05:00
Alex Gleason 3204b61f0b
Add an API to manage admin relays 2024-04-23 16:21:36 -05:00
Alex Gleason 5d84566385 Merge branch 'perf-hydrate-events' into 'main'
Performance: hydrate events makes up to 5 calls to database

See merge request soapbox-pub/ditto!175
2024-04-23 20:24:55 +00:00
P. Reis 58d75d1939 fix: hydrate events stats and author stats with filter by kind 2024-04-23 17:19:34 -03:00
P. Reis 5fca482e5c refactor(hydrate events): change array to Map 2024-04-23 17:04:05 -03:00
Alex Gleason 0f9cc9fe51
zod import alias 2024-04-23 15:03:20 -05:00
Alex Gleason a53a21ffcf
pipeline: print policy result 2024-04-23 01:29:18 -05:00
Alex Gleason 69178ae523
Load a custom policy from data/policy.ts 2024-04-23 01:11:37 -05:00
P. Reis 7a12e5ec7b test: rough adapt tests for new performance hydratation 2024-04-22 22:15:41 -03:00
P. Reis 062e21e8a8 test: remove 'hydrate quote repost WITHOUT hydrate author' 2024-04-22 22:15:41 -03:00
P. Reis b77c8a00cd perf: make up to 5 calls to database in hydrateEvents & remove old hydrate functions 2024-04-22 22:15:36 -03:00
P. Reis 12b030c8aa refactor: decode pubkey with right import in search account 2024-04-20 21:52:36 -03:00
P. Reis 49f06869a3 feat: render account from pubkey if no kind 0 exists - /v2/search 2024-04-20 21:26:05 -03:00
P. Reis 60a1ff7adc feat: render account from pubkey if no kind 0 exists - /v1/accounts/search 2024-04-20 21:03:17 -03:00
Alex Gleason 64d50552b7
Import hono with an import alias 2024-04-20 18:54:15 -05:00
Alex Gleason 505a9bced1
Fix type of AppController 2024-04-20 18:47:34 -05:00
Alex Gleason 0ddb1782e5
DittoDB: support `postgresql:` protocol 2024-04-19 21:20:35 -05:00
Alex Gleason 80e554a5c9
Update deno.json imports 2024-04-19 21:08:13 -05:00
Alex Gleason 9ccf6bbea0
Mold the things to work with Postgres 2024-04-19 20:52:42 -05:00
Alex Gleason b87a59c521
Merge remote-tracking branch 'origin/main' into postgres 2024-04-19 18:32:02 -05:00
P. Reis bbe8df8217 refactor(utils): resolve import specifier via the active import map 2024-04-19 19:46:42 -03:00
Alex Gleason 9c91e41e87
Switch NSpec to Nostrify, update imports 2024-04-19 16:39:35 -05:00
Alex Gleason 450acddc32
Remove pragma.ts 2024-04-19 15:34:05 -05:00
Alex Gleason 2e41254507
Add Postgres adapter 2024-04-19 15:17:09 -05:00
Alex Gleason 3753648f99
Use new DittoDB module, rename old interface to DittoTables 2024-04-19 12:26:15 -05:00
Alex Gleason 4085443e45
Add DittoDB module for selecting a database depending on the DATABASE_URL 2024-04-19 12:21:32 -05:00
Alex Gleason 29102d272a
Add DittoSQLite module 2024-04-19 12:16:48 -05:00
Alex Gleason 1cb53bdb84 Revert "Merge branch 'rework-cache' into 'main'"
This reverts merge request !156
2024-04-19 14:37:53 +00:00
P. Reis e2b377d9c7 fix: reblogged field boolean value takes into account viewerPubkey 2024-04-19 11:12:11 -03:00
P. Reis ae5fe1e0ac fix: hydrate event_stats in hydrateRepostEvents() 2024-04-19 10:23:34 -03:00
Alex Gleason e458f8da13
Introduce DATABASE_URL 2024-04-18 22:11:58 -05:00
P. Reis 7dd6378717 test: improv code coverage in quote repost hydration 2024-04-18 11:30:49 -03:00
Alex Gleason c62c31a171
updateStats: await getStatsDiff 2024-04-17 22:58:25 -05:00
P. Reis e19e41f826 fix: always populate quote_id if possible 2024-04-16 15:16:18 -03:00
P. Reis e4892c3e4a fix: response with quote field hydrated in create status 2024-04-16 14:44:04 -03:00
P. Reis a00a932ec1 refactor: deno fmt in hydrate test 2024-04-16 13:53:00 -03:00
P. Reis ed92001b75 test: fix so copied object is used instead of original object 2024-04-16 13:41:32 -03:00
P. Reis 3219b53682 test: add test for hydrate quote repost without author & fix tests' parallelism problem 2024-04-16 13:25:43 -03:00
P. Reis 4a9232faf7 test: add test for hydrate quote repost 2024-04-16 09:31:03 -03:00
P. Reis d5007162e4 refactor(hydrate): remove empty lines 2024-04-15 17:25:18 -03:00
P. Reis a993051439 refactor: pass abort signal in hydrateRepostEvents 2024-04-15 17:19:37 -03:00
P. Reis 6248272243 feat: add quote repost 2024-04-15 17:19:37 -03:00
P. Reis e77fd7d48b refactor: hydrate authors through hydrateEvents() call 2024-04-15 10:49:10 -03:00
P. Reis b9c1d0c5fb refactor(hydrate test): cast event as DittoEvent instead of any 2024-04-14 22:44:37 -03:00
P. Reis b79f8bef30 test: add test for hydrate repost 2024-04-14 21:02:57 -03:00
P. Reis dd53a111db test: add test to hydrate authors 2024-04-14 19:03:38 -03:00
P. Reis f9831ba74a refactor(events-db-test): resolve import specifier via the active import map 2024-04-14 10:32:22 -03:00
Alex Gleason fe6b42211c Merge branch 'perf-hydrate-repost' into 'main'
Perf hydrate repost

See merge request soapbox-pub/ditto!154
2024-04-13 21:37:54 +00:00
P. Reis 15853d79df refactor: remove kind 1 event from hydrateEvents in reblog controller 2024-04-13 18:31:30 -03:00
P. Reis 37bee709cd perf: hydrate repost events in reblog endpoint & streaming 2024-04-13 18:16:15 -03:00
Alex Gleason ff3d8e3f90
cache: use the old response body to prevent memory leaks 2024-04-13 14:36:31 -05:00
Alex Gleason afed0a0b34
cache: serve stale response 2024-04-13 14:34:37 -05:00
Alex Gleason 6ab3a640bf
Rework cache middleware to use in-memory cache, remove ExpiringCache module 2024-04-13 14:00:21 -05:00
Alex Gleason a738ed3d4d Merge branch 'instance-cache' into 'main'
Cache /api/v1/instance for 5 minutes

See merge request soapbox-pub/ditto!155
2024-04-13 18:30:40 +00:00
Alex Gleason 6aa877d930
Cache /api/v1/instance for 5 minutes 2024-04-13 13:28:08 -05:00
P. Reis 24efca5ea0 perf: hydrate repost event in home timeline 2024-04-12 21:51:57 -03:00
P. Reis 581ecd67d6 refactor(server): resolve import specifier via the active import map 2024-04-12 21:34:32 -03:00
P. Reis 0f4c76c761 refactor(fetch test): resolve import specifier via the active import map 2024-04-12 14:26:45 -03:00
P. Reis 073a3df17e feat: add support for quote repost 2024-04-12 14:07:22 -03:00
P. Reis 3ebcf7ea25 refactor: undo repost counter in getStatsDiff 2024-04-11 09:53:24 -03:00
P. Reis cdb0d817ed fix: repost counter works when undo repost 2024-04-10 19:15:24 -03:00
P. Reis 9f24f35a21 refactor: cast pubkey as string 2024-04-09 20:32:27 -03:00