Merge branch 'streaming-rm-userstore' into 'main'

Streaming: temporarily remove UserStore (allow blocked posts through)

See merge request soapbox-pub/ditto!217
This commit is contained in:
Alex Gleason 2024-05-03 22:44:25 +00:00
commit b60d4fde3d
1 changed files with 2 additions and 6 deletions

View File

@ -9,7 +9,6 @@ import { bech32ToPubkey } from '@/utils.ts';
import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts'; import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts';
import { hydrateEvents } from '@/storages/hydrate.ts'; import { hydrateEvents } from '@/storages/hydrate.ts';
import { Storages } from '@/storages.ts'; import { Storages } from '@/storages.ts';
import { UserStore } from '@/storages/UserStore.ts';
const debug = Debug('ditto:streaming'); const debug = Debug('ditto:streaming');
@ -68,17 +67,14 @@ const streamingController: AppController = (c) => {
const filter = await topicToFilter(stream, c.req.query(), pubkey); const filter = await topicToFilter(stream, c.req.query(), pubkey);
if (!filter) return; if (!filter) return;
const store = pubkey ? new UserStore(pubkey, Storages.admin) : Storages.admin;
try { try {
for await (const msg of Storages.pubsub.req([filter], { signal: controller.signal })) { for await (const msg of Storages.pubsub.req([filter], { signal: controller.signal })) {
if (msg[0] === 'EVENT') { if (msg[0] === 'EVENT') {
const [event] = await store.query([{ ids: [msg[2].id] }]); const event = msg[2];
if (!event) continue;
await hydrateEvents({ await hydrateEvents({
events: [event], events: [event],
storage: store, storage: Storages.admin,
signal: AbortSignal.timeout(1000), signal: AbortSignal.timeout(1000),
}); });