Skip to content

Add unfollow to the mock repo and MockPDS#44

Merged
germ-mark merged 4 commits into
mainfrom
llm/mock-unfollow
Jul 16, 2026
Merged

Add unfollow to the mock repo and MockPDS#44
germ-mark merged 4 commits into
mainfrom
llm/mock-unfollow

Conversation

@germ-mark

Copy link
Copy Markdown
Contributor

Adds the inverse of follow to the mocks: MockRepo.unfollow(did:) removes every follow record whose subject matches, and MockPDS.unfollow(did:from:) delegates to it. The mocks had follow and block but no way to undo a follow, so a "not followed" social-graph state was unconstructible.

Motivation: the germDM anchor welcome route silence-and-relays a not-followed peer (distinct from a blocked peer, which now drops). That not-followed path had no test because the harness couldn't produce the state. MockAtmosphere.unfollow parity is added in AtprotoOAuth (depends on this release), and germDM re-pins to exercise it.

Additive/mock-only; AtprotoClientMocks builds clean. Changeset: minor.

The inverse of `follow`: `MockRepo.unfollow(did:)` removes every follow record
whose subject matches, and `MockPDS.unfollow(did:from:)` delegates to it. Lets a
test construct a "not followed" social-graph state — the anchor welcome route's
silence-and-relay case — which was previously unreachable (the mocks had follow
and block, but no way to undo a follow). MockAtmosphere parity lands in
AtprotoOAuth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 64e1d97

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@germ-network/atprotoclient Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

germ-mark and others added 3 commits July 16, 2026 16:04
Both `getGraph` and the new `unfollow` decoded every record in a graph
collection with `try`, so a single foreign or newer-schema record would abort
the whole read / unfollow. Decode best-effort instead — skip a record that
doesn't parse as its type rather than throwing on it — so one bad record can't
strand the follows/blocks that do decode. Neither can fail now, so both drop
`throws`. A test injects an un-decodable record alongside a real follow and
checks getGraph still returns the good one and unfollow still removes it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The loop already iterated a snapshot (untypedRepo[collection] ?? [:] is
evaluated once and copy-on-write isolates it from the in-loop deletes), but that
relied on value semantics a reader had to infer. Name it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@germ-mark
germ-mark merged commit 468246d into main Jul 16, 2026
20 checks passed
@germ-mark
germ-mark deleted the llm/mock-unfollow branch July 16, 2026 23:11
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant