Skip to content

feat!: Improve transient error handling#171

Draft
Takaros999 wants to merge 3 commits intomainfrom
takis/address-transient-errors
Draft

feat!: Improve transient error handling#171
Takaros999 wants to merge 3 commits intomainfrom
takis/address-transient-errors

Conversation

@Takaros999
Copy link
Contributor

@Takaros999 Takaros999 commented Mar 12, 2026

Motivation

While testing IDKit on Android I saw some transient errors that stopped the bridge polling, in my case there was an obscure DNS error that happened when my android device entered foreground.

Changes

Introduced a new error variant for android and kotlin Error::Transient that is meant to be retried by the SDK user.

  • If someone uses pollUntilCompletion they don't need to change anything, this is an improvemnt
  • if someone uses pollStatusOnce this is a new error they can handle, this is breaking if you have an exhausting switch/when
 when (status) {
      is TransientError -> retry
      is Failed -> stop
  }

Why a new error variant? The current Failed variant indicated the polling is stopped and the error should be handled to make a decision, I believe keeping this separate helps.

@vercel
Copy link

vercel bot commented Mar 12, 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 12, 2026 5:51pm

Request Review

@socket-security
Copy link

socket-security bot commented Mar 12, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
License policy violation: cargo icu_properties_data under Unicode-3.0

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (icu_properties_data-2.1.2/LICENSE)

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (icu_properties_data-2.1.2/Cargo.toml)

From: ?cargo/url@2.5.8cargo/icu_properties_data@2.1.2

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/icu_properties_data@2.1.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo icu_properties under Unicode-3.0

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (icu_properties-2.1.2/LICENSE)

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (icu_properties-2.1.2/Cargo.toml)

From: ?cargo/url@2.5.8cargo/icu_properties@2.1.2

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/icu_properties@2.1.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo linux-raw-sys

License: Apache-2.0 WITH LLVM-exception - the applicable license policy does not allow this license exception (linux-raw-sys-0.12.1/LICENSE-Apache-2.0_WITH_LLVM-exception)

From: ?cargo/ruint@1.17.2cargo/alloy@1.7.3cargo/alloy-sol-types@1.5.7cargo/alloy-primitives@1.5.7cargo/uniffi@0.30.0cargo/alloy-sol-types@0.8.26cargo/alloy-primitives@0.8.26cargo/linux-raw-sys@0.12.1

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/linux-raw-sys@0.12.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo rustix

License: Apache-2.0 WITH LLVM-exception - the applicable license policy does not allow this license exception (rustix-1.1.4/LICENSE-Apache-2.0_WITH_LLVM-exception)

From: ?cargo/ruint@1.17.2cargo/alloy@1.7.3cargo/alloy-sol-types@1.5.7cargo/alloy-primitives@1.5.7cargo/uniffi@0.30.0cargo/alloy-sol-types@0.8.26cargo/alloy-primitives@0.8.26cargo/rustix@1.1.4

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/rustix@1.1.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo unicode-ident under Unicode-3.0

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (unicode-ident-1.0.24/LICENSE-UNICODE)

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (unicode-ident-1.0.24/Cargo.toml)

License: Unicode-3.0 - the applicable license policy does not allow this license (4) (unicode-ident-1.0.24/Cargo.toml)

From: ?cargo/reqwest@0.12.28cargo/ruint@1.17.2cargo/url@2.5.8cargo/serde_json@1.0.149cargo/thiserror@2.0.18cargo/time@0.3.47cargo/alloy@1.7.3cargo/alloy-sol-types@1.5.7cargo/alloy-primitives@1.5.7cargo/wasm-bindgen@0.2.114cargo/wasm-bindgen-futures@0.4.64cargo/tokio@1.50.0cargo/getrandom@0.4.2cargo/taceo-oprf@0.7.1cargo/uuid@1.22.0cargo/world-id-primitives@0.5.1cargo/aes-gcm@0.10.3cargo/thiserror@1.0.69cargo/strum@0.27.2cargo/k256@0.13.4cargo/serde@1.0.228cargo/uniffi@0.30.0cargo/alloy-sol-types@0.8.26cargo/alloy-primitives@0.8.26cargo/getrandom@0.3.4cargo/unicode-ident@1.0.24

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/unicode-ident@1.0.24. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo webpki-roots under CDLA-Permissive-2.0

License: CDLA-Permissive-2.0 - the applicable license policy does not allow this license (4) (webpki-roots-1.0.6/Cargo.toml)

License: CDLA-Permissive-2.0 - the applicable license policy does not allow this license (4) (webpki-roots-1.0.6/LICENSE)

From: ?cargo/reqwest@0.12.28cargo/webpki-roots@1.0.6

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/webpki-roots@1.0.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo wit-bindgen-core

License: Apache-2.0 WITH LLVM-exception - the applicable license policy does not allow this license exception (wit-bindgen-core-0.51.0/LICENSE-Apache-2.0_WITH_LLVM-exception)

From: ?cargo/getrandom@0.4.2cargo/getrandom@0.3.4cargo/wit-bindgen-core@0.51.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wit-bindgen-core@0.51.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo wit-bindgen-rust-macro

License: Apache-2.0 WITH LLVM-exception - the applicable license policy does not allow this license exception (wit-bindgen-rust-macro-0.51.0/LICENSE-Apache-2.0_WITH_LLVM-exception)

From: ?cargo/getrandom@0.4.2cargo/getrandom@0.3.4cargo/wit-bindgen-rust-macro@0.51.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wit-bindgen-rust-macro@0.51.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo wit-bindgen-rust

License: Apache-2.0 WITH LLVM-exception - the applicable license policy does not allow this license exception (wit-bindgen-rust-0.51.0/LICENSE-Apache-2.0_WITH_LLVM-exception)

From: ?cargo/getrandom@0.4.2cargo/getrandom@0.3.4cargo/wit-bindgen-rust@0.51.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wit-bindgen-rust@0.51.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
License policy violation: cargo wit-bindgen

License: Apache-2.0 WITH LLVM-exception - the applicable license policy does not allow this license exception (wit-bindgen-0.51.0/LICENSE-Apache-2.0_WITH_LLVM-exception)

From: ?cargo/getrandom@0.4.2cargo/getrandom@0.3.4cargo/wit-bindgen@0.51.0

ℹ Read more on: This package | This alert | What is a license policy violation?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Find a package that does not violate your license policy or adjust your policy to allow this package's license.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/wit-bindgen@0.51.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@Takaros999
Copy link
Contributor Author

@codex review

@Takaros999 Takaros999 changed the title feat: Improve transient error handling feat!: Improve transient error handling Mar 12, 2026
Copy link

@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: 5aec2f8848

ℹ️ 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
Copy link
Contributor Author

@codex review

Copy link

@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: c1647b00b5

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

match error {
Error::Timeout | Error::ConnectionFailed | Error::BridgeError(_) => true,
#[cfg(any(feature = "bridge", feature = "bridge-wasm"))]
Error::Http(err) => err.is_connect() || err.is_timeout(),

Choose a reason for hiding this comment

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

P1 Badge Treat all HTTP polling errors as transient

is_transient_error only retries Error::Http when err.is_connect() or err.is_timeout() is true, but poll_for_status() can also surface other reqwest transport failures (for example while reading/decoding the poll response) via ?; those currently become StatusWrapper::Failed and stop polling permanently. That defeats this change’s goal of recovering from transient bridge communication issues, because a temporary HTTP-layer glitch can still terminate pollUntilCompletion instead of being retried.

Useful? React with 👍 / 👎.

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.

1 participant