feat(APP-1053): Handle allowed actions based on chainid (6/10) - #1297
Open
milosh86 wants to merge 6 commits into
Open
Conversation
|
🚀 Preview Deployment: View Here |
|
E2E results (preview) Smoke
|
milosh86
marked this pull request as ready for review
August 5, 2026 07:30
milosh86
force-pushed
the
app-1053-handle-allowed-actions-based-on-chainid
branch
from
August 7, 2026 08:59
8f29e41 to
ac7bd71
Compare
Signed-off-by: Milos Dzepina <milos@aragon.org>
…flow Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
Signed-off-by: Milos Dzepina <milos@aragon.org>
milosh86
force-pushed
the
app-1053-handle-allowed-actions-based-on-chainid
branch
from
August 7, 2026 10:05
e95860e to
cc24e26
Compare
Signed-off-by: Milos Dzepina <milos@aragon.org>
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.
Description
Restricts the actions offered by the action composer to the chain they will actually execute on, and
brings the allowed actions into the nested actions dialog so cross-chain payloads are composed
against the right allowlist.
An allowed action may now carry a
chainId, because a single plugin condition can authorise actionsacross several chains.
IAllowedAction.chainIdis optional and not guaranteed to be back-filled, soan action without one is treated as an action of the DAO chain.
useAllAllowedActionsNew query hook wrapping
useAllowedActions, modelled onuseAllDaoPermissions: it auto-paginatesevery page and exposes the full list, keeping
dataundefined until the whole set is loaded soconsumers cannot act on a partial allowlist.
On top of that it filters by chain:
chainIdis optional — when it is not set, the actions of every chain are returned.networkurl param vianetworkDefinitions.chainIdis only kept when the requested chain is the DAO chain(
(action.chainId ?? daoChainId) === chainId).chainIdis deliberately kept out of the request params, so the same plugin's actions are fetchedand cached once instead of once per chain.
Nested actions dialog
The dialog now fetches the allowed actions itself and passes them down through
ProposalActionsEditortoActionComposer. The two networks involved are different and aresourced separately:
allowed actions are indexed;
chainIdcomes fromresolvedNetwork, the chain the nested actions are composedfor.
So a cross-chain forward narrows the DAO-chain plugin's allowlist down to the destination chain, and
untagged (DAO-chain) actions correctly drop out of the offering.
INestedActionsDialogParamschanged accordingly:daoIdis now required,pluginAddressis new andoptional (no plugin means no allowlist and every action is offered), and
networkis re-documented —it is the chain the actions are composed for, not the previous "use outside DAO context" escape
hatch.
Reaching the process plugin from an action component
ICreateProposalFormContextgains an optionalprocessPlugin, populated increateProposalPageClientwhere the plugin is already resolved. gov-ui-kit'sIProposalActionComponentPropsonly exposesactionandindex, and the render path forwardsnothing plugin-related, so the context is the only channel through which an arbitrarily nested custom
action component can learn which process it is being composed for.
CrossChainControllerForwardMessageActionreads it to passpluginAddressinto the dialog. It isoptional because
ProposalActionsEditormounts the same action components from the execute-actionsform and from the nested dialog, where no process plugin exists.
Fixes
useAllowedActionsignoredpageParamin itsqueryFnand always re-requested page 1. That madeevery "load more" in the DAO process allowed-actions list refetch the first page, and would have
turned auto-pagination into an infinite loop.
createProposalFormActionshand-rolledpages.flatMapwithpageSize: 50and no pagination, soit silently truncated at 50 allowed actions. It now uses the new hook.
Notes for reviewers
ActionComposerinfers "only offer authorized actions" fromallowedActions != null(
useState(allowedActions != null), read on first render). Passing[]therefore means "nothingis authorized", not "unrestricted" — which is why the call sites keep the value
undefinedwhen noplugin restricts the actions. For the same reason, if the composer mounts before the allowed
actions have resolved it will offer every action for that mount; worth a look if the dialog should
hold the composer back until the fetch settles.
useAllAllowedActionsquery returns[]rather thanundefined, so every call siteguards the disabled case explicitly. Could be worth pushing into the hook.
Type of Change
Developer Checklist:
Review Checklist: