Skip to content

fix(social) + test(e2e): the follows surface works + the groups e2e floor/gauntlet - #703

Merged
jacoby149 merged 3 commits into
devfrom
test/social-e2e-groups
Aug 28, 2026
Merged

fix(social) + test(e2e): the follows surface works + the groups e2e floor/gauntlet#703
jacoby149 merged 3 commits into
devfrom
test/social-e2e-groups

Conversation

@jacoby149

Copy link
Copy Markdown
Owner

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 followersGroupId returned web10.app/groups/{username}/followers — the wrong shape (missing the users/ segment) and a hardcoded provider instead of the node's. The API derives a created group's ID from the token's provider claim as {provider}/groups/users/{creator}/{slug}, so the app was addressing a group that never exists: the follow button's joinGroup 404'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 to API_HOST).
  • ensureFollowers creates under the bare slug followers with the bare-username owner key (the format joins + discover auto-enrollment use).
  • isFollowing checks getMyGroups() membership (the API's groups/get doesn't return my_role, so the old check was always false).
  • The follow button gets [social] logging at each transition.

The e2e (e2e/tests/social-groups.spec.ts):

  • API floor: the app's exact feed read (getMyGroups minus discover → one multi-group posts read) + the follow/unfollow group ops + the feed-read delta (follow → the creator's post enters the feed; unfollow → it's gone, 403 on a direct read) + the I3 anti-test (a stranger who never followed can't read the followers group).
  • Browser gauntlet: viewer pre-authed via the token cookie → open the creator's /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.ts3/3 green (stable across runs)
  • 200 web10-social unit tests green (follows.test.ts re-aligned to the new ID pattern)
  • tsc -b + vite build clean; e2e spec tsc-clean (remaining e2e tsc errors are pre-existing on dev)
  • Screenshots verified desktop + 375px (follow button Follow→Following, feed reflects it)

…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.
@jacoby149
jacoby149 merged commit a774756 into dev Aug 28, 2026
7 checks passed
@jacoby149
jacoby149 deleted the test/social-e2e-groups branch August 28, 2026 19:51
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