feat(onebot): backfill cloud history after login

Add an opt-in per-account login history backfill that waits for roster warmup and a 30-second grace period before silently filling local message history. The setting defaults to disabled and applies on the next account lifecycle.

Run one account at a time, prioritize known local gaps, and process at most three groups plus three friends with one 20-message page per session. Failures are logged and never retried during the same login.

Persist reconstructed history without dispatching OneBot events or changing QQ read state. Keep private metadata and event bodies atomic, honor recall tombstones, suppress live-only history side effects, avoid extra media requests, and stop queued, in-flight, or converting work when the account closes.

Share the persistence path with manual history actions and add lifecycle, cancellation, corruption, partial-failure, peer-identity, and storage-atomicity regression coverage. Refs #280.
This commit is contained in:
DrSmoothl committed 2026-07-25 23:44:28 +08:00
1 parent b71279dcc3
commit dc2ec1235a
15 files changed
+1810 -68

No files matched your search

@@ -7,6 +7,7 @@ function config(trigger: string): OneBotConfig {
return {
networks: { httpServers: [], httpClients: [], wsServers: [], wsClients: [] },
statusCommand: { enabled: true, swallow: false, cooldownSeconds: 5, trigger },
historySync: { enabled: false },
notifications: { channelIds: [] },
};
}