Skip to content

refactor(ffi): share web-transport-quinn's Android verifier initializer - #522

Merged
kixelated merged 3 commits into
mainfrom
quest/a1/android-verifier-init
Nov 12, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/a1/android-verifier-init

Conversation

@kixelated

@kixelated kixelated commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • web-transport-ffi now calls web-transport-quinn's android::init_platform_verifier instead of having its own copy of the ActivityThread.currentApplication() lookup. Each crate keeps its own policy: the FFI still falls back to bundled webpki roots and retries on each client, and quinn still returns an error.
  • JNI_OnLoad registers the VM singleton with JavaVM::from_raw and then calls the shared initializer. quinn caches a success, so the FFI's own INITIALIZED flag is gone.
  • web-transport-quinn's android module is now #[doc(hidden)] pub and Android-only, so only the FFI uses it.
  • web-transport-noq keeps its copy: it cannot depend on web-transport-quinn, and its only shared dependencies (web-transport-proto, web-transport-trait) have no rustls or JNI. A new crate just for 40 lines did not seem worth it. A module comment now says so.
  • Deletes quest/a1/android-verifier-init.md.

Choices made without asking

  • The FFI now attaches with attach_current_thread_for_scope (quinn's) instead of attach_current_thread. In JNI_OnLoad the thread is already attached. On a retry from a native thread, it now detaches afterwards instead of staying attached, which is the safer behavior.
  • The fallback warning is now one line carrying quinn's error, which links the upstream Android setup.

Public API

web-transport-quinn gains a #[doc(hidden)] android::init_platform_verifier on Android only. It is not a supported API. No other API or wire changes.

Caused by

No single PR caused this. moq-dev/web-transport#511 and moq-dev/web-transport#512 landed separate copies on purpose and planned this follow-up.

Checks

  • just check: passes.
  • cargo clippy --target aarch64-linux-android -- -D warnings for web-transport-quinn and web-transport-ffi, using a rust-overlay toolchain with Android std: passes.
  • Did not run Android clippy for web-transport-noq: ring and aws-lc need an Android sysroot (an NDK) to build, and this host has none. Only a doc comment changed there.
  • Not run on a device or emulator.

Follow-ups

None.

Models

Size: S
Implementer: Claude Code, Opus 5.5, low effort

(Written by Claude Opus 5.5 with low)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1ccca-6eda-7be0-87d6-9d7cc6dfd45b, round 1
  • Head: 1729572
  • Base: origin/main at dd26cd5
  • Score: 9/10, The shared initializer preserves Android initialization retries, exception handling, and bundled-root fallback behavior, with no actionable defects found by code inspection; builds and tests were not run as instructed.
  • Findings: none

kixelated and others added 2 commits November 11, 2026 14:30
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Share one Android platform-verifier initializer refactor(ffi): share web-transport-quinn's Android verifier initializer Nov 11, 2026
@kixelated
kixelated marked this pull request as ready for review November 11, 2026 22:46
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Quinn crate now exposes its Android platform verifier initializer through a public, documentation-hidden module. The FFI client calls the initializer during JNI loading and retries it for each verifier request. A failed request initialization logs a warning and falls back to bundled Mozilla roots. The FFI client’s local Android application lookup functions were removed. The noq module documentation and the Android verifier initialization proposal document were also updated or removed.

Merge Risk: Minimal · up to cde33

This change shares the Android verifier initializer between the Quinn and FFI crates and keeps the existing fallback to bundled roots. No merge-blocking issue was identified. The change was not run on a device or emulator.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names a refactor of web-transport-ffi to share web-transport-quinn's Android verifier initializer, which matches the main change: the FFI now calls quinn's init_platform_verifier, quinn's an…
Description check Passed The description summarizes the changeset in detail. It covers the FFI calling quinn's android::init_platform_verifier, the JNI_OnLoad changes and removal of the INITIALIZED flag, the doc-hidden pub vi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a refactor of web-transport-ffi to share web-transport-quinn's Android verifier initializer, which matches the main change: the FFI now calls quinn's init_platform_verifier, quinn's android module is exposed as doc-hidden pub, and the FFI's own initialization state is removed. It is specific and concise, and it describes the primary change.

Full details: Description check

Explanation

The description summarizes the changeset in detail. It covers the FFI calling quinn's android::init_platform_verifier, the JNI_OnLoad changes and removal of the INITIALIZED flag, the doc-hidden pub visibility of quinn's android module, the retained copy in web-transport-noq, the deletion of quest/a1/android-verifier-init.md, and the attach-function change. It is clearly related to the changeset.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4a0cd4b-598b-4b9a-810d-3c73b1f151cf
Commits

Reviewing files that changed from the base of the PR and between ee6cfd1 and cde3371.

Files selected for processing: 5

  • quest/a1/android-verifier-init.md
  • rs/web-transport-ffi/src/android.rs
  • rs/web-transport-noq/src/android.rs
  • rs/web-transport-quinn/src/android.rs
  • rs/web-transport-quinn/src/lib.rs
Files with no reviewable changes: 1

  • quest/a1/android-verifier-init.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T02:04:15.299392Z cde3371 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated
kixelated enabled auto-merge (squash) November 12, 2026 02:09
@kixelated
kixelated merged commit 869a5c3 into main Nov 12, 2026
32 checks passed
@kixelated
kixelated deleted the quest/a1/android-verifier-init branch November 12, 2026 02:52
@moq-bot moq-bot Bot mentioned this pull request Nov 12, 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.

1 participant