Automattic / Automattic/wordpress-atmosphere

Orphaned site.standard.document records when the linked Bluesky post is deleted

Open
#178 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Publisher enhancement
Dominant language
PHP
Stars
52
Forks
3
Avg merge
2d 1h
Merged PRs (30d)
22

Description

## Summary

When a Bluesky post is removed but its `site.standard.document` is not, the document is left orphaned — it references a `bskyPostRef` that no longer exists in the repo. This most commonly happens when a user deletes the post directly in the Bluesky app (which never touches `site.standard.document`), but a partial delete on our side would produce the same result.

## Evidence

On a live install (`did:plc:u2zy3hpjbhfxkgfzcyfy7fsx`), **12** documents on the plugin's publication reference a `bskyPostRef` post that is absent from the repo. The doc rkey and the missing post rkey share a TID prefix (created together), confirming the post existed and was later removed. Examples:

```
doc 3moaooi6do7vd -> post 3moaooi6zynvd (missing) /2026/06/14/future-prep/
doc 3mo7e27gauxo7 -> post 3mo7e27gwruo7 (missing) /2026/06/13/we-might-as-well-be-strangers-2/
doc 3mnpw56rlhiot -> post 3mnpw56roqaot (missing) /2026/06/06/jim-carol-new-year/
```

(The reporter confirmed they had removed posts.)

## Expected

Decide on a reconciliation policy for documents whose `bskyPostRef` target is gone, e.g.:

* Detect and clean up (or re-link) orphaned documents during an update/sync pass, and/or
* Surface them so they can be pruned.

## Related

* [#44]() (surface `META_ORPHAN_RECORDS` in admin / Site Health)
* Automattic/wordpress-atmosphere#141 (auto-retry a failed un-share)

Contributor guide

Open the contributing guide

Research direction

The issue does not name files or tests; start by tracing the plugin's update/sync path and the handling of site.standard.document bskyPostRef links. Agree on a cleanup, relinking, or surfacing policy, then verify it against the orphan examples and the related orphan-record work.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.