Skip to content

fix: inconsistent validation error when deploying new app interface#547

Merged
PatrickDinh merged 2 commits intomainfrom
fix/app-interface-name-validation
Jan 19, 2026
Merged

fix: inconsistent validation error when deploying new app interface#547
PatrickDinh merged 2 commits intomainfrom
fix/app-interface-name-validation

Conversation

@PatrickDinh
Copy link
Copy Markdown
Contributor

@PatrickDinh PatrickDinh commented Jan 15, 2026

Recording.2026-01-15.135844.mp4

Should fix #517

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jan 15, 2026

Deploying algokit-lora with  Cloudflare Pages  Cloudflare Pages

Latest commit: 684d762
Status: ✅  Deploy successful!
Preview URL: https://67273a78.algokit-lora.pages.dev
Branch Preview URL: https://fix-app-interface-name-valid.algokit-lora.pages.dev

View logs

@PatrickDinh PatrickDinh requested a review from lempira January 15, 2026 03:59
@mrcointreau
Copy link
Copy Markdown
Contributor

I tried it as well and it works now. I still don’t understand why trigger isn’t working, and why we have to manually call react-hook-form’s setError/clearErrors, though.

We should probably apply the same fix to src/features/app-interfaces/components/create/app-details.tsx#L59, right?

@PatrickDinh
Copy link
Copy Markdown
Contributor Author

@mrcointreau the root cause of this issue is Zod only run superRefine logic when all fields passed validation colinhacks/zod#2524.

  • For the app spec with no template => the form is valid => trigger('name') triggers the superRefine logic
  • For the app spec with template params => the form is invalid until all the template param values are populated. The name validation only triggered after you fill in all the values, this is what you reported in this bug.

Therefore, manually set the error seems to be ok to me in this case.

We should probably apply the same fix to src/features/app-interfaces/components/create/app-details.tsx#L59, right?
Good idea, I updated it as well. The trigger shouldn't cause issue there but we can keep them consistent.

Base automatically changed from fix/npm-audit to feat/remove-algosdk January 19, 2026 04:00
@PatrickDinh PatrickDinh force-pushed the fix/app-interface-name-validation branch from 0c6dc85 to 647a011 Compare January 19, 2026 04:05
@PatrickDinh PatrickDinh changed the base branch from feat/remove-algosdk to main January 19, 2026 04:05
@PatrickDinh
Copy link
Copy Markdown
Contributor Author

@mrcointreau I have updated this PR to point to main instead of remove-algosdk branch, if you're ok, I'll go ahead and merge it.

@PatrickDinh PatrickDinh force-pushed the fix/app-interface-name-validation branch from 647a011 to 684d762 Compare January 19, 2026 10:45
@aorumbayev aorumbayev changed the title Fix inconsistent validation error when deploying new app interface fix: inconsistent validation error when deploying new app interface Jan 19, 2026
@PatrickDinh PatrickDinh merged commit 87b7050 into main Jan 19, 2026
2 checks passed
@aorumbayev aorumbayev deleted the fix/app-interface-name-validation branch January 19, 2026 10:57
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.

Inconsistent app interface name validation across contracts in App Lab

2 participants