feat: Respect minikit supported version#142
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98b814510e
ℹ️ 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".
| export function createNativeRequest( | ||
| wasmPayload: unknown, | ||
| config: BuilderConfig, | ||
| signalHashes: Record<string, string> = {}, | ||
| version: 1 | 2, |
There was a problem hiding this comment.
Default verify version when creating native requests
createNativeRequest now requires a version argument but does not provide a runtime default, so any existing JavaScript call site still using the old 3-argument form will send { command: "verify", version: undefined } to World App. Because this helper previously hardcoded v2, that is a behavioral regression for untyped/non-typechecked callers and can cause verification requests to be rejected; setting a default (as the docstring already implies) preserves backward compatibility.
Useful? React with 👍 / 👎.
js/packages/core/src/request.ts
Outdated
| } catch { | ||
| throw new Error( | ||
| "verify v2 is not supported by this World App version. " + | ||
| "Use a legacy preset (e.g. orbLegacy()) or update the World App.", |
There was a problem hiding this comment.
Re-throw non-version errors in v1 preset fallback
The broad catch in the v1 preset branch rewrites every failure into a "verify v2 is not supported" message, including unrelated issues like malformed RP context or other payload-construction errors thrown inside the try block. On hosts that only support v1, this misdiagnoses real configuration problems and points developers to the wrong fix instead of surfacing the actual error.
Useful? React with 👍 / 👎.
- Backtick `MiniKit` in doc comment to satisfy clippy::doc_markdown - Only catch v1-incompatibility errors in preset fallback, re-throw others
This PR checks which
Minikit.verifyversions World App supports: