Skip to content

MOB-98: mix mob.doctor detects the pre-fix component-event JNI mismatch - #45

Merged
GenericJam merged 2 commits into
masterfrom
fix/mob-98-native-component-events
Aug 26, 2026
Merged

MOB-98: mix mob.doctor detects the pre-fix component-event JNI mismatch#45
GenericJam merged 2 commits into
masterfrom
fix/mob-98-native-component-events

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Summary

  • mob_new's template fix (JNI owner mismatch — see companion PR mob_new#35) only repairs newly-generated projects. This repo doesn't auto-patch hand-editable native source in already-generated apps (see enable.ex's detect_stale_pythonx_templates for the established precedent: detect + warn, never blind-overwrite), so an existing app stays broken until a human ports the fix or regenerates.
  • mix mob.doctor's Build section now flags the pre-fix declaration shape in an existing MobBridge.kt, pointing at the same fix mob_new's template already carries.

Test plan

  • mix test — 2120 passed, 3 new tests for __component_event_jni_mismatched__/1
  • mix format / mix credo --strict — clean

Linear: MOB-98 (companion PRs: mob fix/mob-98-native-component-events, mob_new fix/mob-98-native-component-events)

🤖 Generated with Claude Code

mob_new's template fix (JNI owner mismatch — nativeDeliverComponentEvent
declared on MobNativeViewRegistry instead of MobBridge) only repairs
newly-generated projects. This repo doesn't auto-patch hand-editable
native source in existing generated apps (see enable.ex's
detect_stale_pythonx_templates for the established precedent —
detect + warn, never blind-overwrite), so an already-generated app
stays broken until a human ports the fix or regenerates.

mix mob.doctor's Build section now flags the pre-fix declaration shape
in an existing MobBridge.kt, pointing at the same fix mob_new's
template already carries — surfaced by `mix mob.doctor` instead of an
UnsatisfiedLinkError on first real interaction with a tier-2 native
component.
…g ADR

From code review on PR #45:

- __component_event_jni_mismatched__/1 used a plain String.contains?
  requiring "@JvmStatic external fun nativeDeliverComponentEvent" on
  one line. A dev hand-porting the fix with @JvmStatic on its own line
  above external fun — idiomatic Kotlin style — got permanently
  flagged as still broken, since mix mob.doctor only warns and never
  re-checks a fix it can't see was applied. Switched to a runtime-
  compiled regex tolerant of the annotation/declaration split across
  lines (Regex.compile!/1, not a ~r// literal — see mob's AGENTS.md
  rule #9).
- The comment pointed at mob_dev/decisions/ for "why this repo doesn't
  auto-patch hand-editable native source" — no ADR there actually
  covered it; the only real precedent was an inline docstring in
  enable.ex. Wrote decisions/2026-08-25-detect-dont-autopatch-native-source.md
  documenting the decision properly (per this repo's own decision-log
  convention: record it the moment you make the call, not later) and
  pointed the comment at the real file.
@GenericJam
GenericJam merged commit 5da6dc5 into master Aug 26, 2026
3 checks passed
GenericJam added a commit that referenced this pull request Aug 26, 2026
…ettle delay

Ships MOB-98 (mix mob.doctor detects the pre-fix component-event JNI
mismatch) and MOB-99 (the iOS accessibility settle delay only applies
to simulators, not physical devices), both merged from PR #45 and #46
with their review-fix follow-ups.

See CHANGELOG.md for the full breakdown.
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