fix(social) + test(e2e): the follows surface works + the groups e2e floor/gauntlet - #703
Merged
Conversation
…s-group IDs + the groups e2e floor/gauntlet
The app's followersGroupId addressed a group that never exists (wrong shape
+ hardcoded provider), so the follow button's join 404'd and silently reverted.
followersGroupId now returns {provider}/groups/users/{username}/followers (the
deterministic ID the API derives from the token's provider); ensureFollowers
creates under the bare slug with the bare-username owner key; isFollowing uses
getMyGroups (groups/get doesn't return my_role). New e2e/tests/social-groups.
spec.ts: API floor (app's exact feed read + follow/unfollow ops + feed-read
delta + I3 anti-test) + browser gauntlet (real follow button, feed reflects it,
log-sequence verified). 3 e2e green, 200 unit tests green, build clean.
…ded first) + restore blank line
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
The social app's follows surface (social-e2e lane, the M0 machine track) — follows as the app drives them: follow → the creator's posts enter the feed → unfollow → they leave.
The bug: the app's
followersGroupIdreturnedweb10.app/groups/{username}/followers— the wrong shape (missing theusers/segment) and a hardcoded provider instead of the node's. The API derives a created group's ID from the token'sproviderclaim as{provider}/groups/users/{creator}/{slug}, so the app was addressing a group that never exists: the follow button'sjoinGroup404'd and silently reverted to "Follow".The fix (
src/data/groups.ts+follows.ts):followersGroupId(username, provider?)→{provider}/groups/users/{username}/followers(provider = the token's, falling back toAPI_HOST).ensureFollowerscreates under the bare slugfollowerswith the bare-username owner key (the format joins + discover auto-enrollment use).isFollowingchecksgetMyGroups()membership (the API'sgroups/getdoesn't returnmy_role, so the old check was always false).[social]logging at each transition.The e2e (
e2e/tests/social-groups.spec.ts):/u/:username→ follow (the real button) → the post appears in/feed→ unfollow → it leaves, with console log-sequence verification.Group management (create/roles/invite) stays the authenticator + marketing-directory surface — its floors live in
groups-demo.Verification
scripts/run-e2e.sh tests/social-groups.spec.ts→ 3/3 green (stable across runs)follows.test.tsre-aligned to the new ID pattern)tsc -b+vite buildclean; e2e spec tsc-clean (remaining e2e tsc errors are pre-existing on dev)