mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
DittoAPIStore: fix handleEvent not being called
This commit is contained in:
parent
44f3721d36
commit
e99496306a
2 changed files with 9 additions and 9 deletions
|
|
@ -29,13 +29,13 @@ Deno.test('updateAuthorData sets nip05', async () => {
|
||||||
|
|
||||||
const row = await db.kysely
|
const row = await db.kysely
|
||||||
.selectFrom('author_stats')
|
.selectFrom('author_stats')
|
||||||
.select(['nip05', 'nip05_domain', 'nip05_hostname'])
|
.selectAll()
|
||||||
.where('pubkey', '=', getPublicKey(alex))
|
.where('pubkey', '=', getPublicKey(alex))
|
||||||
.executeTakeFirstOrThrow();
|
.executeTakeFirst();
|
||||||
|
|
||||||
assertEquals(row.nip05, 'alex@gleasonator.dev');
|
assertEquals(row?.nip05, 'alex@gleasonator.dev');
|
||||||
assertEquals(row.nip05_domain, 'gleasonator.dev');
|
assertEquals(row?.nip05_domain, 'gleasonator.dev');
|
||||||
assertEquals(row.nip05_hostname, 'gleasonator.dev');
|
assertEquals(row?.nip05_hostname, 'gleasonator.dev');
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupTest(cb: (req: Request) => Response | Promise<Response>) {
|
function setupTest(cb: (req: Request) => Response | Promise<Response>) {
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,10 @@ export class DittoAPIStore implements NRelay {
|
||||||
}
|
}
|
||||||
|
|
||||||
async event(event: NostrEvent, opts?: { signal?: AbortSignal }): Promise<void> {
|
async event(event: NostrEvent, opts?: { signal?: AbortSignal }): Promise<void> {
|
||||||
const { relay, pool } = this.opts;
|
const { pool } = this.opts;
|
||||||
const { id, kind } = event;
|
const { id, kind } = event;
|
||||||
|
|
||||||
await relay.event(event, opts);
|
await this.handleEvent(event, opts);
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -368,7 +368,7 @@ export class DittoAPIStore implements NRelay {
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.handleEvent(rel, { signal: AbortSignal.timeout(1000) });
|
await this.event(rel, { signal: AbortSignal.timeout(1000) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.kind === 3036 && tagsAdmin) {
|
if (event.kind === 3036 && tagsAdmin) {
|
||||||
|
|
@ -384,7 +384,7 @@ export class DittoAPIStore implements NRelay {
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.handleEvent(rel, { signal: AbortSignal.timeout(1000) });
|
await this.event(rel, { signal: AbortSignal.timeout(1000) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue