Repository navigation
Follows: a followed product stays followed after you leave the page - #61
Merged
Merged
Conversation
A product Follow wrote its row, but the overlay (what a page asks to learn what you follow) only asked the table about topics and people. Every product therefore read "Follow" again on the next page, after a reload or after signing back in. resolveFollowKeys now asks about listings too, and answers them in the key the page sent. Also: /me/follow answered "ok" when core did not make the write, so the button kept saying "Following" for a follow that was never saved. It now answers a failure, and the button undoes itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Following a product showed Following, but on the next page, after a reload, or after signing out and back in, it read Follow again.
The follow was saved. The read was the bug: when a page asks the overlay which of its controls you follow,
resolveFollowKeys(core/src/handlers/me.ts) only asked the table abouttopicandpersonkeys.listing(product follows, PP1) was dropped, so a product follow was never in the answer.Fix
resolveFollowKeysasks aboutlistingtargets as they are (a slug, like a topic) and answers them aslisting:<slug>. Person keys still go handle → subject id → handle./me/followansweredokeven when core did not make the write. The enhanced button flips first and reverts only on a non-2xx, so it could keep saying Following for a follow that was never stored. It now answersfailed(502 JSON / redirect back), and the button undoes itself.Existing product follows reappear as soon as this deploys: the rows are already there.
Tests
tests/core/src/follows.test.ts: new overlay cases. A followed product, topic and person all come back in the page's keys, and an unfollowed product does not. The first case fails onmainand passes here.tests/web/src/follows.test.ts: the route answers a non-ok write as a failure.tests/core(1147) andtests/web(2138) pass.coreandwebtypecheck.Security (OWASP)
🤖 Generated with Claude Code