Skip to content

feat(api): add asynchronous historical import jobs - #722

Closed
salmonumbrella wants to merge 1 commit into
kenn-io:mainfrom
salmonumbrella:feat/issue-378-import-jobs
Closed

feat(api): add asynchronous historical import jobs#722
salmonumbrella wants to merge 1 commit into
kenn-io:mainfrom
salmonumbrella:feat/issue-378-import-jobs

Conversation

@salmonumbrella

Copy link
Copy Markdown
Contributor

What changed

  • Add authenticated POST /api/v1/imports and GET /api/v1/imports/{job_id} endpoints for bounded Gmail and IMAP historical imports.
  • Queue imports behind the daemon's archive-operation gate, with process-local status, progress, final counts, timestamps, and sanitized failures.
  • Handle SQLite timestamp precision and resumed sync runs when attributing progress and completion to a job.
  • Publish schema 2.13.0 and regenerate the Go and TypeScript clients.

Why

Remote deployments can inspect and schedule accounts over HTTP, but starting a bounded initial import still requires a local msgvault sync-full bridge. This adds the missing async primitive for operator UIs without exposing arbitrary commands or provider tokens.

Usage

curl http://localhost:8080/api/v1/imports \
  -H "Authorization: Bearer $MSGVAULT_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"account":"you@example.com","after":"2024-01-01","limit":5000}'

Poll GET /api/v1/imports/{job_id} until the job reaches done or failed.

Closes #378

@roborev-ci

roborev-ci Bot commented Aug 30, 2026

Copy link
Copy Markdown

roborev: Combined Review (3fb4cfc)

Verdict: No Critical, High, or Medium severity findings.

The reviewers identified no actionable issues meeting the reporting threshold.


Reviewers: 2 done | Synthesis: codex, 5s | Total: 9m17s

@wesm

wesm commented Sep 1, 2026

Copy link
Copy Markdown
Member

reviewing

@wesm wesm self-assigned this Sep 1, 2026
@wesm

wesm commented Sep 1, 2026

Copy link
Copy Markdown
Member

this work appears to have gotten done twice in #721 and #722, but slightly differently. the clankers appear to prefer #721, let me know what you want to do before I put work into getting one of them merged

@salmonumbrella

Copy link
Copy Markdown
Contributor Author

#721 it is!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Expose bounded historical imports as authenticated async HTTP jobs

2 participants