Skip to content

feat(web): add CommunityFactory authorization preflight to community creation - #280

Merged
Caneryy merged 2 commits into
stolla-labs:mainfrom
esthereze:fix/community-factory-auth-preflight
Aug 30, 2026
Merged

feat(web): add CommunityFactory authorization preflight to community creation#280
Caneryy merged 2 commits into
stolla-labs:mainfrom
esthereze:fix/community-factory-auth-preflight

Conversation

@esthereze

Copy link
Copy Markdown
Contributor

Summary

Adds a CommunityFactory authorization preflight to community creation so the UI no longer invites any connected wallet to create a Community only to have create_community reject non-owners after transaction work begins. Plan ID N1, aligning to FR-4 / UJ-1.

What changed

  • The CommunityDeploymentAdapter gained a readFactoryOwner(factoryId, publicKey) method (with a real default implementation that reads owner() via a read-only simulation).
  • CommunityDeploymentPanel now resolves an authorization state during creation readiness before any simulation or wallet approval:
    • ready, disconnected, network-unknown, wrong-network, unauthorized, read-failed, and a brief checking.
  • The owner comparison is network-aware: the factory owner is only read and compared when the wallet network matches the application network, so a wallet on the wrong network is reported as wrong-network, never as unauthorized.
  • Unauthorized wallets cannot reach the deploy approval ("Approve and deploy") action.
  • A failed factory owner read surfaces a retryable read-failed state with a "Retry owner check" button — it is never reported as unauthorized.
  • The blocked message explains that creation is limited during the pilot.

Tests

  • Added component tests covering: non-owner blocked at the deploy approval action, disconnected state, network-aware comparison (read not performed on a mismatched network, no unauthorized message), and read-failure being retryable rather than unauthorized.
  • Updated the e2e deployment fixture to implement readFactoryOwner.

Verification

  • npm run lint — passes (only pre-existing warnings remain).
  • npm run typecheck — passes.
  • npm test — the CommunityDeploymentPanel and CreateCommunityPage suites pass. Several unrelated pre-existing test failures remain on main (files this PR does not touch: ProposalDetailPage, voteAggregation, CreateCommunityWizard, stellar.test, communityFactory/deployment.test & types.test); they fail identically without this change.

Notes on pre-existing CI breakage repaired in this PR

main could not currently pass npm ci (the committed root package-lock.json was missing @testing-library/user-event) and had committed type/lint errors. To allow CI to run at all, this PR also:

  • syncs the root lockfile so npm ci succeeds, and
  • fixes committed type/lint errors in contracts.ts, useNetworkGuard.ts, useCommunityDeployment.ts, useTransactionLifecycle.ts, and the proposals pages.

Closes #257

…creation

Read the factory owner during creation readiness, compare it with the
connected wallet (only when the wallet network matches the application
network), and surface ready, disconnected, network-unknown, wrong-network,
unauthorized, and read-failed states before any simulation or wallet
approval. Unauthorized wallets can no longer reach the deploy approval
action, and a factory owner read failure is retryable rather than reported
as unauthorized.

Also repair pre-existing breakage on main that blocked CI: sync the stale
root lockfile (missing @testing-library/user-event broke `npm ci`), and fix
committed type/lint errors in contracts.ts, useNetworkGuard.ts,
useCommunityDeployment.ts, useTransactionLifecycle.ts, and the proposals
pages.

Closes stolla-labs#257
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@esthereze is attempting to deploy a commit to the caneryy's projects Team on Vercel.

A member of the Team first needs to authorize it.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Caneryy
Caneryy merged commit 36621d3 into stolla-labs:main Aug 30, 2026
1 check failed
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.

Add CommunityFactory authorization preflight to community creation

2 participants