Document pipeline fixes and post-onboarding uploads

fix

2026-02-06 · stayairworthy

Cleared out a handful of document pipeline bugs and let users upload more documents after onboarding is done. The juicy one was BackgroundTasks: I was wrapping the async task in asyncio.run() which spun up a fresh event loop and produced "Future attached to a different loop" errors against asyncpg. Handing the coroutine straight to BackgroundTasks fixes it. Also added an idempotency guard so a document already in processing or processed status doesn't get reprocessed, taught the Tensorlake parser that page_classes can come back as either a dict or a list, dropped a stale ocr_confidence field that isn't on the model, and wired up an upload modal on the dashboard with an aircraft picker for owners with more than one tail number.

4 commits across 1 repo (savvyai: 4). 6 files changed. Diff was truncated for summarization.