Skip to content

AAO: discovered_properties.source column to enable property-removal reconciliation in hosted sync #4111

@bokelley

Description

@bokelley

Context

PR #4106 added hosted-property → federated-index sync. Authorizations are fully reconciled (rows we own with source='aao_hosted' are deleted when the manifest drops them). Properties cannot be — the discovered_properties table has no source column, so we can't safely distinguish hosted-written rows from crawler-written rows.

What's needed

Add a source column to discovered_properties:

ALTER TABLE discovered_properties
  ADD COLUMN source TEXT NOT NULL DEFAULT 'crawler'
  CHECK (source IN ('crawler', 'aao_hosted'));

Backfill: existing rows get 'crawler' (the default). Update the hosted-property sync to write 'aao_hosted' and reconcile on re-sync (delete rows for (publisher_domain, source='aao_hosted') not in the new manifest).

Why it matters

Today, a publisher who removes a property from their AAO-hosted manifest sees the property persist on the publisher page until manually cleared. Small but visible inconsistency. Tracked as a known limitation in the merged changeset; this issue is the cleanup.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedIssue has been triaged by the Claude Code triage routine. Remove to re-triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions