Skip to content

fix: Fix error handling in native transport#177

Merged
Takaros999 merged 3 commits into
mainfrom
takis/fix-error-handling-native-transport
Mar 18, 2026
Merged

fix: Fix error handling in native transport#177
Takaros999 merged 3 commits into
mainfrom
takis/fix-error-handling-native-transport

Conversation

@Takaros999
Copy link
Copy Markdown
Contributor

@Takaros999 Takaros999 commented Mar 17, 2026

Summary

This PR fixes an issue with error handling in the native transport (Mini App context). The problem was that we didn't handle the error in the .pollOnce function.

I took the chance to refactor the way we handle the in-flight promise:

  • the inflight promise can only resolve with IDKitCompletionResult type
  • one .complete() entrypoint
  • removed flags like this.resolved, this.settled, this.cancelled

Before

IDkit.before.fix.mp4

After

Fix.error.handling.in.mini.app.context.mp4

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
idkit-js-example Ready Ready Preview, Comment Mar 17, 2026 11:23pm

Request Review

}

async pollOnce(): Promise<Status> {
if (this.resolved && this.resolvedResult) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main problem was here. we didn't handle the error case


app.post("/api/rp-signature", (req, res) => {
const { ttl } = req.body;
const { ttl, action } = req.body;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was forgotten, took the chance to fix

@Takaros999
Copy link
Copy Markdown
Contributor Author

@codex review

@Takaros999 Takaros999 marked this pull request as ready for review March 17, 2026 23:00
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7afb4b046f

ℹ️ 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".

Comment thread js/packages/core/src/transports/native.ts
@Takaros999
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33ca5ce71f

ℹ️ 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".

Comment thread js/packages/core/src/transports/native.ts Outdated
@Takaros999
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ 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".

@Takaros999 Takaros999 merged commit 3ac658a into main Mar 18, 2026
16 checks passed
@Takaros999 Takaros999 deleted the takis/fix-error-handling-native-transport branch March 18, 2026 16:29
This was referenced Mar 18, 2026
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.

2 participants