Skip to content

Reduce automation sync write amplification #318

Closed

Description

@itsmiso-ai

Parent umbrella issue: #308
Source audit: Weekly tech debt audit: dispatch - 2026-06-03
Source audit date: 2026-06-03

Original recommendation

P3 — Reduce automation sync write amplification: batch obvious independent writes or introduce bounded concurrency after locking is settled.

Matched top finding

Scheduled sync has a DB-backed single-row lock, but normal issue sync and automation sync do not appear to share that lock. Browser refreshes, cron overlap, or repeated clicks can trigger concurrent GitHub scans and per-run/per-job writes.

Evidence:

  • src/app/api/sync/scheduled/route.ts:13-59 has acquireLock() / releaseLock().
  • src/app/api/sync/route.ts:8-65 performs issue sync without that lock.
  • src/app/api/automation/sync/route.ts:329-356 loops through tracked repos; syncRepo() does multiple GitHub calls and upserts per workflow/run/job/release/PR/package.

Activity

  1. added
    auditAudit, review, or investigation work.
    status/backlogNot ready for worker pickup yet.
    on Jun 4, 2026
  2. itsmiso-ai commented on Jun 5, 2026

    @itsmiso-ai
    ContributorAuthor

    Saffron grooming result: kept in backlog — needs locking settled first

    P3 concurrent sync writes depend on lock coordination between scheduled, normal, and automation sync. Cannot scope until locking is established.

  3. added
    status/readyReady for Dispatch worker pickup.
    status/in-reviewPull request or human review is in progress.
    and removed
    status/backlogNot ready for worker pickup yet.
    status/readyReady for Dispatch worker pickup.
    on Jun 5, 2026
  4. added and removed
    status/in-reviewPull request or human review is in progress.
    on Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit, review, or investigation work.status/doneWork is complete.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions