Skip to content

fix(APP-965): Derive SPP proposal creation restriction from sub-plugin rules#1218

Merged
milosh86 merged 2 commits into
mainfrom
app-965-proposal-eligibility-shows-unrestricted-for-eligible-wallets
Jul 15, 2026
Merged

fix(APP-965): Derive SPP proposal creation restriction from sub-plugin rules#1218
milosh86 merged 2 commits into
mainfrom
app-965-proposal-eligibility-shows-unrestricted-for-eligible-wallets

Conversation

@thekidnamedkd

@thekidnamedkd thekidnamedkd commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes APP-965: the process details page showed "Unrestricted: anyone can create a proposal" for any connected wallet that was eligible to create one, even when the SPP process has real creation rules.

Root cause

APP-4547 (#766) moved the SPP proposal-creation guard to an RPC simulation (useSimulateProposalCreation, a useCall for the connected account) but left the guard's isRestricted derived from that wallet-scoped result:

isRestricted: !permissionGranted // permissionGranted = hasSimulationSucceeded

isRestricted is a process-level fact ("are there restrictions on the action" — see IPermissionCheckGuardResult; token derives it from minProposerVotingPower > 0, multisig from onlyListed), so an eligible wallet (simulation succeeds) flipped the whole process to "Unrestricted" in PermissionsDefinitionList. The negative path (ineligible wallet) rendered correctly, which is why this only showed for wallets that could create.

Fix

useSppPermissionCheckProposalCreation now aggregates isRestricted from the sub-plugin creation rules (restricted when any stage body restricts creation — the same source the displayed settings already came from), while hasPermission keeps using the RPC simulation for the wallet-level gate.

Testing

  • New useSppPermissionCheckProposalCreation.test.ts (5 cases): reproduces the bug against the pre-fix hook (restricted process + eligible wallet → was rendering unrestricted) and covers restricted/unrestricted aggregation, hasPermission from the simulation, and loading composition.
  • type-check, lint:check, and the jest suite pass; additionally verified red→green from a clean checkout in an isolated linux/arm64 sandbox (deny-by-default network, node 24) as part of the sealbox clean-room dogfood.
  • Changeset included (@aragon/app patch).

Linear: APP-965

@thekidnamedkd thekidnamedkd requested a review from a team as a code owner July 9, 2026 22:28
@linear-code

linear-code Bot commented Jul 9, 2026

Copy link
Copy Markdown

APP-965

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🚀 Preview Deployment: View Here

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

E2E results (preview)

Smoke

Base URL https://app-next-an41yyok9-aragon-app.vercel.app
Suite smoke
Playwright result ✅ passed
Summary 79 passed, 1 skipped
HTML report View report
GitHub job ✅ completed

View run #4463

…n rules

The process details page showed 'Unrestricted: anyone can create a proposal'
for any wallet the creation simulation succeeded for. isRestricted now
aggregates the sub-plugin creation rules; hasPermission keeps the simulation.
@thekidnamedkd thekidnamedkd force-pushed the app-965-proposal-eligibility-shows-unrestricted-for-eligible-wallets branch from 2e8a4a0 to 4dcf850 Compare July 10, 2026 08:39

@milosh86 milosh86 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍


// The simulation only checks the connected wallet's permission; whether the process itself is restricted comes
// from the sub-plugin creation rules.
const isRestricted = pluginProposalCreationGuardResults.some(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably could've used settings.length as a proxy for isRestricted too, but I think your version reads better 👍

@milosh86 milosh86 merged commit f21414e into main Jul 15, 2026
17 checks passed
@milosh86 milosh86 deleted the app-965-proposal-eligibility-shows-unrestricted-for-eligible-wallets branch July 15, 2026 11:59
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