Skip to content

Unify sync-stage metadata across error classification, notifications, and metrics #169

Description

@darron

Follow-up from PR #166 (merged as 218c1035).

The sync-stage set is maintained independently in three places:

  • internal/syncjob/stage_error.go: parseKnownStage
  • internal/notify/catalog.go: knownSyncStages
  • internal/metrics/metrics.go: notificationMetricFailureTypes

Adding, renaming, or removing a stage now requires synchronized edits. If the lists drift:

  • WrapStageError can fail to preserve the stage identity.
  • Notification classification can fall back to sync.unknown.
  • Notification metrics can normalize a valid stage failure to sync.unknown.

PR #166 required parallel updates for the Bluesky and Mastodon bookmark stages, which exposed the maintenance risk.

Proposed resolution:

  • Define one canonical stage metadata source, or add a generated/compile-time mechanism that derives the consumer registries.
  • Keep the existing public failure type and error-code names stable.
  • Add a regression test that fails when an enabled sync stage is missing from stage-error recognition, notification catalog lookup, or notification metric validation.
  • Document any intentional distinction between internal stage IDs and emitted metric/source names.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions