Skip to content

Surface sync and import failures with row-level context #105

Description

@joshka

Parent: #100

Related Gitcrawl context: openclaw/gitcrawl#81

Observed Workflow

During initial Discrawl use, sparse database errors made it hard to tell whether a sync failure was a data-shape problem, an idempotency problem, or a local write-path bug.

One concrete case involved duplicate attachment insert errors. The useful first fix was not a broad behavior change; it was adding row-level context around the failing insert so the attempted attachment id, message id, guild id, channel id, author id, filename, content type, and size were visible.

Current Workaround

Without row context, failures have to be diagnosed by reading code, reproducing locally, or adding temporary logging.

That makes coverage and retry decisions harder because missing or partial data may reflect:

  • not attempted yet
  • failed during sync
  • failed during local write
  • fixed after retry
  • intentionally skipped

Request

Surface sync/import/write failures with durable, queryable context.

Example shape:

discrawl failures --json
discrawl doctor --recent-failures --json

Suggested tracked fields:

  • operation
  • source, such as discord, wiretap, snapshot, media, embeddings
  • guild id
  • channel id
  • message id, when applicable
  • attachment id or related row id, when applicable
  • error class
  • error message
  • first seen time
  • last seen time
  • retry count
  • resolved time

Why This Matters

Codex-assisted archive use depends on knowing whether local data is missing because it has not been fetched yet, because a previous fetch failed, or because a local data-shape bug needs a targeted report. Without a ledger, that context disappears into shell logs.

Acceptance Criteria

  • Recent sync/import/write failures are queryable in JSON.
  • Failure context includes relevant Discord row identifiers when available.
  • Successful retry or later ingestion can mark a failure resolved.
  • Coverage/progress output can distinguish known failures from missing/unattempted rows.
  • Existing raw SQLite errors are wrapped with enough row context before behavior changes are made.

Prepared with Codex, confirmed as accurate by human.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossThis issue is about lost, corrupted, or silently dropped user/session/config data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions