Skip to content

Make mob.uninstall actually honour :ios_bundle_id, and stop the deploy error lying - #68

Merged
GenericJam merged 2 commits into
masterfrom
fix/uninstall-ios-bundle-id-and-flag-message
Sep 5, 2026
Merged

Make mob.uninstall actually honour :ios_bundle_id, and stop the deploy error lying#68
GenericJam merged 2 commits into
masterfrom
fix/uninstall-ios-bundle-id-and-flag-message

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Both found by an adversarial review of a documentation PR. The docs claimed these behaved correctly; checking the claims found that they did not. Two defects I shipped, in the two commits before this one.

mix mob.uninstall ignored :ios_bundle_id entirely

The task resolved one bundle id for both platforms and passed it down as project_bundle_id. resolve_apps_for_device/3 then did opts[:project_bundle_id] || default_bundle_id(device) — the || short-circuits, so the per-platform clause that was the entire point of the change was dead code on every real invocation. On a device holding the app under a different :ios_bundle_id, uninstall removed nothing and reported success.

The test could not see it: it passed [] for opts, which is not the shape the task sends. Resolution now happens where the device is known, the task passes only whether it is in a Mix project, and the tests use the task's own opts. One asserts the two shapes still agree — that mismatch is what hid the bug, more than the logic did.

The deploy error told you your working spelling was wrong

mix mob.deploy's invalid-option message advised that a dash-prefixed value needs the equals form. That was true until join_dashed_values/1 landed in the same commit as the advice and made the spaced form work. A small version of the thing this whole run has been about.

2333 tests, credo and format clean.

GenericJamand others added 2 commits September 5, 2026 08:53
…y error lying
Both found by an adversarial review of a documentation PR — the docs claimed
these behaved correctly, and checking the claims found that they did not. Two
defects I shipped, in the two commits before this one.
`mix mob.uninstall` resolved one bundle id for both platforms in the task and
passed it down as `project_bundle_id`. `resolve_apps_for_device/3` then did
`opts[:project_bundle_id] || default_bundle_id(device)`, so the `||`
short-circuited and the per-platform clause — the entire point of the change —
was dead code on every real invocation. On a device holding the app under a
different `:ios_bundle_id`, uninstall removed nothing and reported success.
The test could not see it: it passed `[]` for opts, which is not the shape the
task sends. Resolving the id now happens where the device is known, the task
passes only whether it is in a Mix project, and the tests use the task's own
opts. One of them asserts the two shapes still agree, since that mismatch is
what hid the bug rather than the logic itself.
Separately, `mix mob.deploy`'s invalid-option error advised that a value
beginning with `-` needs the equals form. That was true until
`join_dashed_values/1` landed in the same commit as the advice and made the
spaced form work. Telling someone their working spelling is wrong is a small
version of the thing this whole run has been about.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Strict option parsing turned `mix mob.deploy --help` into
`Unrecognized or invalid option(s): --help` — the flag people try first, on
the task they run most, telling them to go and read the help. `mix mob.mutate`
shipped with the same hole a day later.
`mix mob.uninstall` had already solved this: `MobDev.TaskHelp` exists for it,
and its moduledoc explains why (Mix has `mix help <task>`, but people from
outside the Elixir ecosystem expect `<command> --help` to work). Both tasks now
use it.
Found by an adversarial review of the documentation PR, which noticed that a
README paragraph celebrating the new refusal did not mention that it also
refused --help.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@GenericJam
GenericJam merged commit 3fdd193 into masterSep 5, 2026
3 checks passed
Sign up for freeto 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

@GenericJam