Skip to content

fix(billing): cancelling a member's repository seat cancels that seat - #502

Merged
jfrench9 merged 3 commits into
mainfrom
bugfix/cancel-the-members-seat
Oct 14, 2026
Merged

jfrench9 merged 3 commits into
mainfrom
bugfix/cancel-the-members-seat

Conversation

@jfrench9

@jfrench9 jfrench9 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Repository seats are per member, and an owner or admin sees every member's seat on Organization → Subscriptions. Cancelling one sent no user_id, so the API cancelled the owner's own seat while the member's kept billing. The cancel now names the row's seat, and each card says whose seat it is.

Changes

  • organization/billing-panels.tsx:
    • The repository cancel sends the row's user_id.
    • Each card reads "Your seat" or "A member's seat".
    • Change Plan shows only on the viewer's own seat, since Browse changes only the viewer's own.
  • repositories/content.tsx: the cancel sends the row's user_id.

Deploy Notes

Bumps @robosystems/core to 0.15.0 (the own-seat fix this change depends on) and @robosystems/client to 2.12.0, in this PR. Safe to merge as one unit.

Testing

New vitest cases: cancelling a member's seat sends that member's id, and the cards label and gate Change Plan. The cancel test fails without the fix. npm test (711 tests), lint and typecheck pass, before and after the package bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_014Wxgk4yttBxgdE2uBHT71R

@github-actions github-actions Bot added the change:normal Normal change: automated review documented on the pull request before merge label Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Change classification: normal — platform or application code changed.

A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The change-classification job requests that review and passes once it has been posted. Recorded by the change-classification job.

@jfrench9

Copy link
Copy Markdown
Member Author

@claude please review this PR

@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Claude finished @jfrench9's task in 16s —— View job


Review of PR #502

  • Read the diff against origin/main
  • Checked the call sites and tests

Verdict: looks good, with one merge blocker (already in your Deploy Notes) and a few small points.

The fix is correct and small. The repository cancel now sends the row's user_id, so the API no longer falls back to the caller's own seat. Both cancel paths are covered: organization/billing-panels.tsx and repositories/content.tsx.

Blocker

  • Core bump is still missing. package.json still has @robosystems/core: ^0.14.1. Your notes say /repositories lists a member's seat as the owner's own on 0.14.1, so this change would cancel that member's access from there. Please bump to the core release before merging.

Points to consider

  1. isMySeat treats a missing user_id as the viewer's own (billing-panels.tsx, !sub.user_id || ...). That is a reasonable default for legacy rows. But if useUser() returns no user while loading, every seat with a user_id shows "A member's seat" and Change Plan is hidden until the user loads. That is a brief flicker, not a correctness issue. You could render nothing for the label until user is available.

  2. isMySeat sits between useState calls. It is a plain function, so it is safe. Moving it below the hooks would keep the hook block contiguous.

  3. Duplicated cancel body. Both files now build the same { user_id, immediate, confirm } body. This is fine for now. A shared helper would stop them drifting apart if more fields are added.

  4. Test gaps. The new tests only cover a member's seat. Adding two cases would help:

    • Cancelling your own seat sends your own id.
    • A row with no user_id sends undefined and keeps Change Plan visible.

    There is also no test for repositories/content.tsx, which has the same fix.

  5. Not verified here. Dependencies are not installed on this runner, so I did not run npm test, lint or typecheck. I also could not confirm that the SDK's cancel body type includes user_id. Your description says tests, lint and typecheck pass, and CI should confirm.

No security concerns. The server must still check that the caller may cancel another member's seat, and that is not visible in this repo.
· branch bugfix/cancel-the-members-seat

Core 0.15.0 carries the own-seat fix this branch's cancel depends on.

Claude-Session: https://claude.ai/code/session_014Wxgk4yttBxgdE2uBHT71R
@jfrench9
jfrench9 merged commit 42442ef into main Oct 14, 2026
9 of 10 checks passed
@jfrench9
jfrench9 deleted the bugfix/cancel-the-members-seat branch October 14, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:normal Normal change: automated review documented on the pull request before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant