docs(quick-260721-fy8): fix mimecast and qbo sync scheduler dispatch and reschedule mimecast cron
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
db7db98374
commit
6eafaae40a
2 changed files with 49 additions and 5 deletions
|
|
@ -4,8 +4,8 @@ milestone: v3.0
|
|||
milestone_name: Phishing Triage Automation
|
||||
status: Awaiting next milestone
|
||||
stopped_at: Phase 23 context gathered
|
||||
last_updated: "2026-07-17T10:55:33.806Z"
|
||||
last_activity: 2026-07-17 — Milestone v3.0 completed and archived
|
||||
last_updated: "2026-07-18T15:20:36.300Z"
|
||||
last_activity: "2026-07-18 — Completed quick task 260718-9qg: QBO integration handoff document"
|
||||
progress:
|
||||
total_phases: 9
|
||||
completed_phases: 9
|
||||
|
|
@ -28,7 +28,7 @@ See: .planning/PROJECT.md (updated 2026-07-14)
|
|||
Phase: Milestone v3.0 complete
|
||||
Plan: —
|
||||
Status: Awaiting next milestone
|
||||
Last activity: 2026-07-18 — Completed quick task 260718-9qg: QBO integration handoff document
|
||||
Last activity: 2026-07-21 — Completed quick task 260721-fy8: fix mimecast and qbo sync scheduler dispatch and reschedule mimecast cron
|
||||
|
||||
## Performance Metrics
|
||||
|
||||
|
|
@ -130,6 +130,7 @@ None yet.
|
|||
| 260717-v6c | Add "Mark as accidental report" action to the phishing Action Area — closes out a campaign and posts a fixed customer-facing note to the reporter (distinct from the silent "Mark as false positive" action) | 2026-07-18 | 565a0c1 | [260717-v6c-add-a-mark-as-accidental-report-action-t](./quick/260717-v6c-add-a-mark-as-accidental-report-action-t/) |
|
||||
| 260718-7v8 | Fix Mimecast blast-radius false positives — date-scope `getHeldMessages()` and add a sender-domain relevance guard so unrelated held mail in a recipient's queue no longer inflates held/matched counts or overwrites a genuinely delivered recipient's status | 2026-07-18 | b7d6be4 | [260718-7v8-fix-mimecast-blast-radius-held-message-f](./quick/260718-7v8-fix-mimecast-blast-radius-held-message-f/) |
|
||||
| 260718-9qg | Add self-contained `QBO_INTEGRATION_HANDOFF.md` documenting Pulse's QuickBooks Online OAuth2 flow, token storage/refresh, sandbox/production API base URLs, and gotchas (deletion-diffing, CSRF state gap, NEXTAUTH_URL legacy var) for a new app's team | 2026-07-18 | ea8a36b | [260718-9qg-create-a-quickbooks-online-integration-h](./quick/260718-9qg-create-a-quickbooks-online-integration-h/) |
|
||||
| 260721-fy8 | Fix missing `mimecast-sync`/`qbo` scheduler dispatch branches (both silently fell through to a generic Autotask full sync) and reschedule `mimecast-sync` off the 2am 3-way cron collision with `qbo-sync-2am` and `veeam-full` | 2026-07-21 | db7db98 | [260721-fy8-fix-mimecast-and-qbo-sync-scheduler-disp](./quick/260721-fy8-fix-mimecast-and-qbo-sync-scheduler-disp/) |
|
||||
|
||||
## Deferred Items
|
||||
|
||||
|
|
@ -160,9 +161,9 @@ Items acknowledged and deferred at v3.0 milestone close on 2026-07-17 (pre-fligh
|
|||
|
||||
## Session Continuity
|
||||
|
||||
Last session: 2026-07-16T22:37:09.979Z
|
||||
Last session: 2026-07-18T15:20:36.295Z
|
||||
Stopped at: Phase 23 context gathered
|
||||
Resume file: .planning/phases/23-classification-disposition-per-client-automation-gate/23-CONTEXT.md
|
||||
Resume file: None
|
||||
</content>
|
||||
|
||||
## Operator Next Steps
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
phase: quick-260721-fy8
|
||||
plan: 01
|
||||
subsystem: sync-scheduler
|
||||
tags: [scheduler, mimecast, qbo, migration, bugfix]
|
||||
key-decisions:
|
||||
- mimecast-sync and qbo dispatch branches use incrementalSync (not fullSync) — matches the manual /api/qbo/sync non-full path and is correct for a twice-daily recurring job
|
||||
- Chose 45 4 * * * for mimecast-sync's new cron slot — minute 45 is unused anywhere in the live sync_schedules table, avoiding 0 4 (contract-services, pax8-daily), 30 4 (tickets-reconcile), the hourly :15 device-link job, and the veeam */30 :00/:30 jobs
|
||||
- Migration 101 guards the UPDATE on the stale '0 2 * * *' value so it's a no-op if already moved and won't clobber an admin's manual schedule change made via /admin after this ships
|
||||
status: complete
|
||||
---
|
||||
|
||||
# Quick Task 260721-fy8: Fix mimecast and qbo sync scheduler dispatch and reschedule mimecast cron
|
||||
|
||||
**One-liner:** Added missing `mimecast-sync` and `qbo` dispatch branches to `sync-scheduler.ts` (both previously fell through to a generic Autotask full sync, silently never running their real sync logic) and rescheduled `mimecast-sync` off the 2am three-way cron collision with `qbo-sync-2am` and `veeam-full`.
|
||||
|
||||
## What was done
|
||||
|
||||
### Task 1 — Dispatch branches (`lib/services/sync-scheduler.ts`, commit `9311f10`)
|
||||
- Extended the `ScheduleConfig.sync_type` union to add `'mimecast-sync'` (`'qbo'` was already present).
|
||||
- Added an `else if (config.sync_type === 'mimecast-sync')` branch: dynamically imports `isMimecastConfigured` from `mimecast-client.ts`; if not configured, logs a skip line matching the engagement/zoom wording. Otherwise dynamically imports and calls `runMimecastIncrementalSync()` from `mimecast-sync-service.ts`, logging a one-line summary using the real `MimecastSyncResult` fields (`messagesUpserted`, `threatsUpserted`, `bodiesFetched`, `purgedMessages`, `errors.length`, `durationMs`).
|
||||
- Added an `else if (config.sync_type === 'qbo')` branch: queries `integration_settings` for `key = 'qbo'` (mirroring the `pax8-daily` disable-check pattern exactly); if disabled, logs a skip line; otherwise dynamically imports `getQboSyncService` and calls `.incrementalSync('scheduled')`.
|
||||
- Both new branches sit before the final `'incremental'` branch and catch-all `else`, which are unchanged — the catch-all remains reachable only for `'full'`/legacy full-sync types.
|
||||
- `npx tsc --noEmit --pretty` passes clean.
|
||||
|
||||
### Task 2 — Reschedule migration (`migrations/101_reschedule_mimecast_sync.sql`, commit `f447ac3`)
|
||||
- New guarded migration: `UPDATE sync_schedules SET cron_expression = '45 4 * * *', updated_at = NOW() WHERE id = 'mimecast-sync' AND cron_expression = '0 2 * * *'` — a no-op if already moved, safe against clobbering a manual admin change.
|
||||
- Applied the same UPDATE directly against the live `pulse-postgres` container (migrations only auto-apply on first volume boot per CLAUDE.md) — confirmed live: `mimecast-sync` now reads `45 4 * * *`; `qbo-sync-2am` and `veeam-full` unchanged at `0 2 * * *` (collision eliminated for mimecast-sync specifically, as intended — qbo-sync-2am and veeam-full no longer contend with mimecast-sync, though qbo-sync-2am and veeam-full still share 2am with each other, which was out of scope for this task).
|
||||
|
||||
## Verification
|
||||
|
||||
- `npx tsc --noEmit --pretty` — clean.
|
||||
- Live DB: `SELECT cron_expression FROM sync_schedules WHERE id = 'mimecast-sync'` → `45 4 * * *`.
|
||||
- No existing branch (`phishing-sweep`, `pax8-daily`, `veeam-*`, `incremental`, catch-all) modified.
|
||||
- No test file exists for `sync-scheduler.ts` (only `mimecast-client.test.ts`), so no test changes were made, per plan constraint.
|
||||
|
||||
## Deviations from plan
|
||||
|
||||
None. Both tasks executed exactly as planned.
|
||||
|
||||
## Note on this SUMMARY.md
|
||||
|
||||
This file was originally written by the executor inside its isolated git worktree but was lost when the orchestrator removed the worktree (`git worktree remove --force`) without first running the standard rescue-before-remove step. Reconstructed immediately after from the executor's final report text and the actual `git show` output of both commits — content is accurate but not verbatim the original (same recovery situation documented previously in this repo for quick task 260717-a19).
|
||||
Loading…
Add table
Add a link
Reference in a new issue