Repository navigation
MOB-418: on-device self-test (MobWake.SelfTest) - #2
Merged
Merged
Conversation
One read-only :mob_wake_nif.platform_signal/0 call. iOS: any
background_refresh_status passes. Android: passes only with
has_context: true; the Zig NIF now answers {:error, :bridge_not_registered}
/ {:error, :no_jni_env} instead of %{} so an unregistered bridge can't look
healthy. Mob.Wake.status/1 folds those into %{} as before.
…signal fold, erts.errorTuple
Owner
Author
|
Review: reviewer agent (read-only
CI |
Owner
Author
|
Device verification (MOB-418 group B), blank host
Native call: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of MOB-418 / epic MOB-410 (mob_ci nightly e2e).
Native call proving init
MobWake.SelfTest.run/1makes one read-only call::mob_wake_nif.platform_signal/0. No UI, nothing scheduled, no state left behind.UIApplication.backgroundRefreshStatus(main thread)%{background_refresh_status: :available | :denied | :restricted}:pass(denied/restricted are the user's/MDM setting)MobWakeBridge.platformSignal()%{battery_optimized: bool, has_context: true}:pass(bridge registered + app context set)%{battery_optimized: bool, has_context: false}{:fail, "MobWakeBridge has no app context …"}register()never ran / method-ID lookup failed{:error, :bridge_not_registered}{:fail, …}{:error, :no_jni_env}{:fail, …}.erlstubnif_not_loadedraised{:fail, "mob_wake_nif is not linked …"}{:fail, …}No skip branch: nothing here needs hardware or the user.
Native fix (Android)
platform_signal/0used to return%{}when the bridge wasn't registered or no JNIEnv was available — the same answer as a host without the NIF, so a broken host looked healthy. It now returns{:error, :bridge_not_registered}/{:error, :no_jni_env}(like the mob_location pilot, GenericJam/mob_location#8).Mob.Wake.status/1folds those intoplatform_signal: %{}, so its public contract is unchanged. Compile-checked locally withzig build-obj -target aarch64-linux-androidagainst mob 0.9.15'smob_erts.zig/mob_zig.zig.Other
selftest: MobWake.SelfTest,mob_version: "~> 0.9"{:mob, "~> 0.9 and >= 0.9.15"},{:mob_dev, "~> 0.7.17", …}; mix.lock updatedclassify/2covers every branch, each asserted withMob.Plugin.SelfTest.result?/1; hostrun/1hits the stub → fail; manifest declares the self-test with no validator warning. 44 tests, 0 failures; format + credo --strict clean.