Skip to content

fix(nitrogen): preserve ULong callbacks across JNI - #1632

Open
mrousavy wants to merge 1 commit into
mainfrom
fix/kotlin-ulong-callbacks
Open

fix(nitrogen): preserve ULong callbacks across JNI#1632
mrousavy wants to merge 1 commit into
mainfrom
fix/kotlin-ulong-callbacks

Conversation

@mrousavy

@mrousavy mrousavy commented Sep 7, 2026

Copy link
Copy Markdown
Member

Kotlin mangles callback methods that use ULong, so the generated JNI lookup and native registration cannot resolve their names. Add an invoke_jni adapter with a stable name and use Long only inside the JNI bridge. The Kotlin API remains (ULong) -> ULong, and conversions preserve all 64 bits, including values above Long.MAX_VALUE.

This follows #1591, which is now merged. This PR targets main and includes the unsigned callback E2E tests and their generated bindings. Long/void coverage and the primitive boxing simplification were merged in #1591.

Validation:

  • 22 selected Android Harness E2E tests passed before the rebase, including UInt64 roundtrips through ULong.MAX_VALUE on both C++ and Kotlin backends.
  • 42 direct Android JNI checks passed, including nullable ULong, unsigned boundary values, and void callbacks in both directions.
  • Android debug build, TypeScript builds/typechecks, lint, and generated-file reproducibility passed before the rebase.
  • Rebased cleanly onto main after fix(nitrogen): look up Kotlin callbacks with a boxed return type聽#1591 merged; git range-diff confirms the ULong patch is unchanged.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
nitro-docs Skipped Skipped Sep 7, 2026 7:20pm UTC

Request Review

@mrousavy
mrousavy force-pushed the fix/kotlin-ulong-callbacks branch from f11f316 to ab0ed38 Compare September 7, 2026 19:20
@mrousavy
mrousavy changed the base branch from stack/pr-1591 to main September 7, 2026 19:20
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