v27: ENSJobPages preview hardening + FreeTrialSubdomainRegistrar alpha-agent mint flow#1468
v27: ENSJobPages preview hardening + FreeTrialSubdomainRegistrar alpha-agent mint flow#1468MontrealAI wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f1955018e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if(local.ok && freeTrialRegistrar){ | ||
| const available = await freeTrialRegistrar.methods.available(node).call().catch(()=>null); | ||
| availableText = available === null ? 'unavailable (read failed)' : (available ? 'available' : 'unavailable'); | ||
| await freeTrialRegistrar.methods.validateLabel(local.label).call().catch(()=>{ availableText = 'invalid by contract'; }); |
There was a problem hiding this comment.
Treat false validateLabel responses as invalid
The contract label cross-check only updates state on exceptions, so if validateLabel(...) returns false instead of reverting (which matches the previous ABI shape), availableText can remain available and the mint button is enabled. In that scenario, users can submit registerSimple for an invalid label and spend gas on a transaction that will predictably revert; the returned value needs to be checked and treated as invalid when false.
Useful? React with 👍 / 👎.
| const ms = n > 1e12 ? n : n * 1000; | ||
| return new Date(ms).toLocaleString(); | ||
| } | ||
| function normalizeAlphaLabel(raw){ return String(raw || '').trim().toLowerCase().replace(/[^a-z0-9]/g, ''); } |
There was a problem hiding this comment.
Reject illegal label characters instead of stripping them
This normalization removes disallowed characters before validation, so a user input like alpha-agent01 is silently converted to alphaagent01 and can be minted under a different label than the user originally typed. Because the UI now mutates invalid input rather than failing validation, operators can accidentally register unintended names; illegal characters should be rejected explicitly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04dda1996e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if(parentStatus){ | ||
| const active = !!(Array.isArray(parentStatus) ? parentStatus[0] : parentStatus.active); | ||
| const parentLocked = !!(Array.isArray(parentStatus) ? parentStatus[1] : parentStatus.parentLocked); | ||
| const registrarAuthorised = !!(Array.isArray(parentStatus) ? parentStatus[2] : parentStatus.registrarAuthorised); | ||
| const parentUsable = !!(Array.isArray(parentStatus) ? parentStatus[3] : parentStatus.parentUsable); |
There was a problem hiding this comment.
Clear registrar readiness flags on failed status reads
refreshFreeTrialRegistrarState only writes registrar readiness inside the if (parentStatus) success path, so when getParentStatus(...) fails the previous APP_STATE.registrar.parentUsable value is retained; updateAlphaMintPreview then gates minting with stale state and can re-enable minting/admin flows even though registrar posture is unknown. This is a regression from the previous reset behavior and can lead users to send transactions that predictably revert and waste gas after transient RPC/read failures.
Useful? React with 👍 / 👎.
Motivation
AGIJobManager.ensJobPages()wiring and clearly shows a labeled degraded fallback when needed.*.alpha.agent.agi.ethENS subname via the on-chainFreeTrialSubdomainRegistrarwhile preserving write gating and accurate disclosure.Description
AGIJobManager.ensJobPages()first and displays the resolved address and source (AGIJobManager getter/verified fallback/unavailable), reads liveENSJobPagesfields, and shows clear public-prerequisite honesty and tokenURI-mode distinctions.FreeTrialSubdomainRegistrarABIand supportingNameWrapperreads, new constants for the registrar and parent node, and a dedicatedalphaAgentMintSectionUI (preview card, registrar state table, recent names, and expert admin accordion).available(childNode),validateLabel(...)cross-checks, child node/namehash preview, and an in-page transaction review modal which submitsregisterSimple(parentNode, label, newOwner)withvalue: 0.NameRegisteredwhen present, stores recent names locally, auto-fillsagentSub, triggers the existingverifySubdomain('agent', true)flow, and updates mission readiness and badges.setupDomain,activateParent,deactivateParent, andremoveParentwhenwrapper.canModifyName(parentNode, wallet)returns true, and integrated expertregister(...)affordance in an advanced section.alert()/confirm()/prompt()are used.Testing
node --checkon the extracted inline script blocks and they passed.alphaAgentMintSectionusing a headless browser against a local HTTP server to validate layout on small viewports (screenshot captured successfully).alert()/confirm()/prompt()) and found none.resolveEnsJobPagesContract,updateEnsJobPagePreview, andrefreshFreeTrialRegistrarStateare invoked from the normal refresh/connect flows and were exercised during local UI load (no fatal errors from those reads in the environment used for testing).Codex Task