Skip to content

Commit 8bd0d7c

Browse files
invalidate subdomains on delete (#2882)
1 parent 2c261fc commit 8bd0d7c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/backend/drivers/subdomain/SubdomainDriver.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ export class SubdomainDriver extends PuterDriver {
213213
const [shaped] = await this.#hydrateRows(
214214
updated ? [updated as Record<string, unknown>] : [],
215215
);
216+
217+
try {
218+
this.clients.event.emit(
219+
'subdomain.update',
220+
{ subdomain: row.subdomain as string },
221+
{},
222+
);
223+
} catch {
224+
// Non-critical.
225+
}
226+
216227
return shaped ?? null;
217228
}
218229

@@ -299,6 +310,17 @@ export class SubdomainDriver extends PuterDriver {
299310
await this.stores.subdomain.deleteByUuid(row.uuid, {
300311
userId: row.user_id,
301312
});
313+
314+
try {
315+
this.clients.event.emit(
316+
'subdomain.delete',
317+
{ subdomain: row.subdomain as string },
318+
{},
319+
);
320+
} catch {
321+
// Non-critical.
322+
}
323+
302324
return { success: true, uid: row.uuid };
303325
}
304326

0 commit comments

Comments
 (0)