Skip to content

docs(client): correct closeSubscriptionAuthority description - #219

Closed
dev-jodee wants to merge 1 commit into
fix/doc-sponsor-subscription-rent-scopefrom
fix/doc-close-authority-not-kill-switch
Closed

docs(client): correct closeSubscriptionAuthority description#219
dev-jodee wants to merge 1 commit into
fix/doc-sponsor-subscription-rent-scopefrom
fix/doc-close-authority-not-kill-switch

Conversation

@dev-jodee

@dev-jodee dev-jodee commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #218.

Summary

Docs-only (clients/typescript/README.md). The closeSubscriptionAuthority row called it a "kill switch (invalidating all delegations)", but that instruction only closes the SubscriptionAuthority PDA and returns rent — it does not revoke the ATA's SPL delegate, and a same-slot re-init reuses init_id to keep delegations live. The actual spend kill switch is revokeSubscriptionAuthority (which revokes the SPL delegate).

  • Rewrites the closeSubscriptionAuthority entry to state PDA-close + rent only, steer spend-revocation to revokeSubscriptionAuthority, and note the init_id/slot caveat.

Test Plan

  • Docs only; just fmt clean. No code/behavior change.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solana-subscriptions-program Ready Ready Preview, Comment Jul 24, 2026 4:13pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Greptile Summary

This docs-only PR corrects a misleading description for closeSubscriptionAuthority in the TypeScript client README. The old wording called it a "kill switch (invalidating all delegations)", which was incorrect: the instruction only closes the SubscriptionAuthority PDA and reclaims rent, leaving the ATA's SPL delegate intact.

  • Rewrites the closeSubscriptionAuthority row to accurately state PDA-close + rent reclaim only, directing users who want to stop spending to revokeSubscriptionAuthority.
  • Adds the important caveat that a same-slot re-init reuses init_id and keeps existing delegations live.

Confidence Score: 5/5

Docs-only change with no code or behavior modification; safe to merge.

The change is limited to a single table row in a README. The corrected description accurately reflects the on-chain semantics of closeSubscriptionAuthority (PDA close + rent only, no SPL delegate revocation) and appropriately steers users to revokeSubscriptionAuthority for spend revocation. No logic, tests, or generated code are touched.

No files require special attention.

Important Files Changed

Filename Overview
clients/typescript/README.md Documentation-only fix: corrects the closeSubscriptionAuthority description from an inaccurate 'kill switch' claim to the accurate PDA-close + rent-reclaim behavior, with a pointer to revokeSubscriptionAuthority for spend revocation.

Sequence Diagram

sequenceDiagram
    participant User
    participant closeSubscriptionAuthority
    participant revokeSubscriptionAuthority
    participant SubscriptionAuthorityPDA
    participant ATA_SPLDelegate

    Note over User: Wants to stop all spending
    User->>closeSubscriptionAuthority: call (old, incorrect "kill switch")
    closeSubscriptionAuthority->>SubscriptionAuthorityPDA: close PDA + reclaim rent
    Note over ATA_SPLDelegate: SPL delegate still active!
    ATA_SPLDelegate-->>User: delegations remain live

    Note over User: Correct approach
    User->>revokeSubscriptionAuthority: call
    revokeSubscriptionAuthority->>ATA_SPLDelegate: revoke SPL delegate
    revokeSubscriptionAuthority->>SubscriptionAuthorityPDA: close PDA + reclaim rent
    ATA_SPLDelegate-->>User: spending stopped
Loading

Reviews (6): Last reviewed commit: "docs(client): correct closeSubscriptionA..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Compute Unit Report

Instruction Samples CUs Est Cost (Low) [SOL] Est Cost (Med) [SOL] Est Cost (High) [SOL] Δ Avg vs main
cancel_subscription 28 1838 0.000005000 0.000005073 0.000005919
cancel_subscription_now 5 1873 0.000005000 0.000005074 0.000005936
close_subscription_authority 22 1804 0.000005000 0.000005072 0.000005902
create_fixed_delegation 50 3524 0.000005001 0.000005140 0.000006762
create_plan 138 3501 0.000005001 0.000005140 0.000006750
create_recurring_delegation 35 3556 0.000005001 0.000005142 0.000006778
delete_plan 9 359 0.000005000 0.000005014 0.000005179
init_subscription_authority 231 6310 0.000005001 0.000005252 0.000008155
resume_subscription 4 2041 0.000005000 0.000005081 0.000006020
revoke_abandoned_delegation 3 403 0.000005000 0.000005016 0.000005201
revoke_abandoned_subscription 2 2052 0.000005000 0.000005082 0.000006026
revoke_delegation 24 282 0.000005000 0.000005011 0.000005141
revoke_subscription_authority 8 5070 0.000005001 0.000005202 0.000007535
subscribe 52 6642 0.000005001 0.000005265 0.000008321
transfer_fixed 10 5641 0.000005001 0.000005225 0.000007820
transfer_recurring 21 5749 0.000005001 0.000005229 0.000007874
transfer_subscription 14 6029 0.000005001 0.000005241 0.000008014
update_plan 30 1958 0.000005000 0.000005078 0.000005979

🔺 increase · 🔻 decrease · – unchanged · 🆕 new · 🗑 removed (vs main)

Generated: 2026-07-24

@dev-jodee
dev-jodee force-pushed the fix/doc-close-authority-not-kill-switch branch from 94f690d to 14c7aa4 Compare July 21, 2026 18:37
@dev-jodee
dev-jodee force-pushed the fix/doc-close-authority-not-kill-switch branch from 14c7aa4 to 9970aa2 Compare July 21, 2026 18:43
@dev-jodee
dev-jodee force-pushed the fix/doc-close-authority-not-kill-switch branch from 9970aa2 to 9030ae1 Compare July 21, 2026 18:48
@dev-jodee
dev-jodee force-pushed the fix/doc-close-authority-not-kill-switch branch from 9030ae1 to c30d417 Compare July 21, 2026 18:51
@dev-jodee
dev-jodee requested review from amilz and tiago18c July 21, 2026 20:37
amilz
amilz previously approved these changes Jul 24, 2026
stack merge was automatically disabled July 24, 2026 16:01

Pull Request is not mergeable

stack merge was automatically disabled July 24, 2026 16:03

Pull Request is not mergeable

stack merge was automatically disabled July 24, 2026 16:12

Pull Request is not mergeable

closeSubscriptionAuthority only closes the SubscriptionAuthority PDA and
returns rent; it does not revoke the ATA's SPL delegate, and a same-slot
re-init reuses init_id to keep delegations live. Drop the "kill switch"
wording and point spend-revocation to revokeSubscriptionAuthority.
@dev-jodee

Copy link
Copy Markdown
Collaborator Author

Superseded by #221, which consolidates the remaining commits of this stack after #214 merged.

@dev-jodee dev-jodee closed this Jul 24, 2026
@dev-jodee
dev-jodee deleted the fix/doc-close-authority-not-kill-switch branch July 30, 2026 14:34
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.

2 participants