From 1de0ccdfd6f08b338856ea08912a72d55fc822e1 Mon Sep 17 00:00:00 2001 From: Natalie Date: Mon, 29 Jun 2026 11:35:13 -0400 Subject: [PATCH] feat(server): wire outbox + read features into app + my surface Co-Authored-By: Claude Opus 4.8 --- src/server/src/app/server.ts | 6 ++++++ src/server/src/surfaces/my/index.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/server/src/app/server.ts b/src/server/src/app/server.ts index b33d253..c45859a 100644 --- a/src/server/src/app/server.ts +++ b/src/server/src/app/server.ts @@ -8,6 +8,7 @@ import { calendarSendItemMigrations } from '@/entities/calendarSendItem'; import { callMigrations } from '@/entities/call'; import { contactMigrations } from '@/entities/contact'; import { conversationMigrations } from '@/entities/conversation'; +import { conversationReadMigrations } from '@/entities/conversation-read'; import { devicePermissionsMigrations, DevicePermissionsRepo } from '@/entities/device-permissions'; import { deviceMigrations } from '@/entities/device'; import { eventMigrations } from '@/entities/event'; @@ -31,6 +32,7 @@ import { adminSurface } from '@/surfaces/admin'; import { openDb, runMigrations, pgRun, getDb } from '@/shared/db'; import { logger } from '@/shared/logger'; import { startEmbeddingWorker } from '@/features/embedding/worker'; +import { startOutboxSweep } from '@/features/outbox'; import { loadConfig } from './config'; import { deviceTokenAuth, serviceTokenAuth } from './middleware/auth'; @@ -69,6 +71,7 @@ export async function createApp() { ...prospectMigrations, ...outreachMigrations, ...outboxMigrations, + ...conversationReadMigrations, ]); // Start incremental embedding worker — fire and forget; crashes reconnect automatically @@ -76,6 +79,9 @@ export async function createApp() { logger.error('failed to start embedding worker', { err: String(err) }); }); + // Outbox retry backstop: reclaim rows wedged in `sending` (Handoff 03). + startOutboxSweep(); + const app = new Hono() .onError(errorHandler) .use('*', bodyLimit({ maxSize: 100 * 1024 * 1024 })) // 100MB for large iMessage batch uploads diff --git a/src/server/src/surfaces/my/index.ts b/src/server/src/surfaces/my/index.ts index c280d77..ffeb379 100644 --- a/src/server/src/surfaces/my/index.ts +++ b/src/server/src/surfaces/my/index.ts @@ -9,6 +9,7 @@ import { notesMyRouter } from './notes'; import { outboxMyRouter } from './outbox'; import { photosMyRouter } from './photos'; import { prospectsMyRouter } from './prospects'; +import { readMyRouter } from './read'; import { remindersMyRouter } from './reminders'; import { searchMyRouter } from './search'; @@ -21,6 +22,7 @@ export const mySurface = new Hono() .route('/reminders', remindersMyRouter) .route('/notes', notesMyRouter) .route('/outbox', outboxMyRouter) + .route('/read', readMyRouter) .route('/search', searchMyRouter) .route('/contacts', contactsMyRouter) .route('/prospects', prospectsMyRouter);