Skip to content

Deps: allow device_info_plus 12 and 13 - #1

Merged
mishamyte merged 1 commit into
DarkFlippers:qunleashedfrom
mishamyte:chore/device-info-plus-13
Nov 11, 2026
Merged

mishamyte merged 1 commit into
DarkFlippers:qunleashedfrom
mishamyte:chore/device-info-plus-13

Conversation

@mishamyte

Copy link
Copy Markdown
Member

device_info_plus: ">=10.0.1 <12.0.0" -> ">=10.0.1 <14.0.0", in
super_native_extensions and super_context_menu. Nothing else changes.

Why the ceiling matters more than the bump

The whole use of the package, in both files, is three members:

final deviceInfo = await DeviceInfoPlugin().deviceInfo;   // long_press_handler.dart:146
if (deviceInfo is AndroidDeviceInfo) {                    // :206
  if (deviceInfo.version.sdkInt <= 30) {                  // :207

mobile_menu_widget_builder.dart:215 reads the same three, for sdkInt >= 29.
None of them changed in 12 or 13. What those majors did break misses both
packages:

12.0.0 removes AndroidDeviceInfo.serialNumber - neither package reads it
12.0.0 Android build floor: AGP 8.12.1, Gradle 8.13, Kotlin 2.2.0
13.0.0 win32 5 -> 6, and with it Flutter 3.41.6, Dart 3.11.0, iOS 13, macOS 10.15
13.1.0 lowers those again to Dart 3.10.0 and Flutter 3.38.1

So the pin is not holding back an API change. It is holding a ceiling, and a
ceiling in a package taken from path is binding on the app above it:
device_info_plus 13 is the only release on the win32 6 side of the split,
and package_info_plus >=10.1.0, share_plus >=13.1.0 and device_info_plus
13 all require win32 ^6.0.1 while file_picker 8.x and device_info_plus
11.x pin win32 ^5. None of the four can move alone, which makes this one
line - three lines of Android SDK check deep - the thing that blocks all of
them downstream.

Upstream reached the same range: superlistapp/super_native_extensions on
main has ">=10.0.1 <14.0.0" in both packages as of 0.10.0-dev.2, so this
also removes a divergence rather than adding one.

What this does not prove

check_and_lint resolves, formats, analyses and tests; no job here builds an
Android app. The AGP 8.12.1 / Gradle 8.13 / Kotlin 2.2.0 floor 12.0.0 added is
therefore not checked by this PR, and is the consumer's to meet before it
actually resolves 12 or 13.

Both packages read the same three members - `DeviceInfoPlugin().deviceInfo`,
`is AndroidDeviceInfo` and `version.sdkInt` - and none of them changed in 12
or 13. What those majors did break misses both: 12.0.0 removed
`AndroidDeviceInfo.serialNumber`, which neither reads, and 13.0.0 raised the
win32 floor to 6.0.0, with Flutter 3.41.6, Dart 3.11.0, iOS 13 and macOS 10.15
behind it - floors 13.1.0 then lowered again to Dart 3.10.0 and Flutter 3.38.1.

The ceiling is what makes it worth touching. A `<12.0.0` pin here forbids
device_info_plus 13 in any app that takes these packages from path, and 13 is
the only release on the win32 6 side of the split. So this one constraint,
three lines of Android SDK check deep, is what blocks package_info_plus 10.1,
share_plus 13.1 and file_picker 13 downstream - all four need win32 ^6.0.1 and
none of them can move alone.

Matches upstream, which widened both packages to this same range in
0.10.0-dev.2.

One thing this repository cannot check for a consumer: 12.0.0 also raised the
Android build floor to AGP 8.12.1, Gradle 8.13 and Kotlin 2.2.0, and no job
here builds an Android app. That floor is the consumer's to meet.
@mishamyte
mishamyte merged commit 059a6db into DarkFlippers:qunleashed Nov 11, 2026
2 of 8 checks passed
@mishamyte
mishamyte deleted the chore/device-info-plus-13 branch November 11, 2026 16:58
mishamyte added a commit to DarkFlippers/qUnleashed that referenced this pull request Nov 11, 2026
`lib/modules/extensions` 48558d0 -> 059a6db, which is
`DarkFlippers/super_native_extensions#1`: `device_info_plus` widened from
`">=10.0.1 <12.0.0"` to `">=10.0.1 <14.0.0"` in `super_native_extensions` and
`super_context_menu`, the range upstream itself reached in 0.10.0-dev.2.

**Nothing resolves differently.** `flutter pub get --enforce-lockfile` exits 0
and `pubspec.lock` is byte-identical, because 11.5.0 still satisfies the wider
range. This commit removes a ceiling and takes nothing, which is the whole
point of doing it on its own: the bump that uses the headroom is a different
change with a different risk.

The ceiling was ours. Wave 2 could not take the win32 5 -> 6 chain -
`package_info_plus` >=10.1.0, `share_plus` >=13.1.0 and `device_info_plus` 13
all need `win32 ^6.0.1`, while `file_picker` 8.x and `device_info_plus` 11.x
pin `win32 ^5`, so none of the four moves alone - and the resolver named a
submodule, not a package on pub, as what forbade the only release on the
win32 6 side. Its entire use of `device_info_plus` is three members, in two
files, and none of them changed in 12 or 13.

**What still blocks the chain, and it is not Dart.** `device_info_plus` 12.0.0
also raised the Android build floor to AGP 8.12.1, Gradle 8.13 and Kotlin
2.2.0. `android/settings.gradle.kts` pins AGP **8.11.1**, which is below it;
Gradle 8.14 and Kotlin 2.2.20 are above. iOS 15 and macOS 12 clear 13.0.0's
13.0 and 10.15, and `AndroidDeviceInfo.serialNumber`, which 12.0.0 removed, is
read nowhere here. So the remaining prerequisite is an AGP bump, and neither
the submodule's CI nor `ci.yml` builds an Android app to catch it.

**What the submodule's CI proved, and what it did not.** Its `Flutter` job
passed: it resolved `device_info_plus` 13.3.0 and ran format, analyze and test
over both packages, which is the whole of what that change can affect. All six
`Rust` jobs were red, none of them for a reason this change could reach:
Windows failed `cargo clippy -- -D warnings` on untouched Rust (seven
`double_must_use` errors raised inside `#[async_trait]`'s own expansion, one
`collapsible_match` in `win32/data_object.rs`), both macOS jobs were cancelled
without ever being given a runner, and Ubuntu spent 66 minutes failing to
resolve `azure.archive.ubuntu.com` in `apt-get install libgtk-3-dev`. That
workflow runs `rustup default stable|nightly` with no pinned toolchain, so
`-D warnings` adopts every lint each new clippy adds; this pull request was the
first time it had ever run on that fork, so it had no green baseline to lose.

Fixing those lints there is its own task, and not a lockfile line: the
`double_must_use` fix landed in `async-trait` 0.1.92, which requires `syn ^3`,
while that lockfile holds syn 1.0.109 and 2.0.65 - a new dependency tree in a
repository that ships precompiled native binaries, rather than a bumped pin.

Gates here: `flutter pub get --enforce-lockfile` clean, `flutter analyze`
clean, 2530 tests green, `check_format.sh` clean.
mishamyte added a commit to DarkFlippers/qUnleashed that referenced this pull request Nov 11, 2026
…492)

* Take the dependency updates that are safe, and hold the two that are not

`flutter pub upgrade` with no pubspec edits moves 65 packages: 11 direct, 2
direct dev, 52 transitive. Three needed a decision rather than a lockfile
line, and two of the three are held behind a ceiling with the reason written
down.

**firebase_messaging 16.4.1 -> 16.7.1 adds `AuthorizationStatus.deniedPermanently`**,
which breaks the exhaustive switch in `push_service.dart`. It folds into
`denied` for the reason `probes.dart` already gives for folding
`permission_handler`'s own `permanently_denied`: `PermissionOutcome` has no
`permanentlyDenied`, because the route out of each is the same settings page.
The fold also preserves behaviour exactly - the Android plugin answers 3 where
16.4.1 answered 0, and 0 was already `denied`.

`outcomeOf` is now `@visibleForTesting` with a table test over all five
statuses, because the arms encode a product decision that nothing executable
stated: `flutter analyze` only requires the switch to be *exhaustive*, so
pointing any single arm at a different outcome passed the analyzer, all 2523
tests and the format gate together. Checked by mutating
`deniedPermanently => granted`, which now fails two cases. The switch keeps no
`default`, so the next status the plugin adds breaks the build the way this one
did.

**archive is held at `<4.6.0`, and not for the reason I first wrote.** The
first version of this commit claimed 4.6.0 introduced silent acceptance of a
truncated firmware archive. That was measured on 4.6.0 only, and it is wrong.
Measured since on the installer's own call at all three versions:

                           4.0.9        4.5.2        4.6.0
  truncated, no flags      silent       silent       silent
  truncated, verify        silent       silent       THROWS
  truncated, decodeStream  true (!)     false        false
  bad gzip CRC, no flags   THROWS       THROWS       silent, full length
  bad gzip CRC, verify     THROWS       THROWS       THROWS

A truncated archive has been silently partial at every version, production
included - a pre-existing hole, which `archive-4.5.2`'s own doc comment on
`GZipDecoder.decodeBytes` describes. The loss at 4.6.0 is the CRC row: a
bit-rotted download that throws today with no flags decodes clean there. That
row alone is the hold.

Two consequences worth keeping. First, 4.6.0 is the version to migrate *to*:
it is the only one where a flag catches truncation. Second, row three means
the gate for a half-downloaded update becomes buildable at 4.5.2 and was not
at 4.0.9 - `decodeStream` returns false there and returned true before. That
is a defect this bump makes fixable, not one it causes.

What a partial bundle costs is also narrower than I wrote: the Flipper
CRC-checks what it is handed (`dfu_file_validate_crc`, and `radio_crc` from
the manifest, both under `CHECK_RESULT` in `update_task_worker_flasher.c`), so
a truncated `.dfu` is refused on-device rather than flashed. The cost is a
full upload over BLE and an update that dies at validation - plus
`resources.tar`, which carries no CRC in the manifest and is unpacked
unvalidated. The md5 sentence stands: `_remoteMatches` compares the device
against a digest of the extracted bytes, so it is an upload-skip optimisation
with no independent reference and cannot catch a bad extraction.

Taking the bump means auditing all seven decode sites, two of them in the
`dartufbt` submodule - a PR in another repository plus a bump here. It also
changes what `ZipDecoder` returns for an unreadable local header
(named-with-no-content, where 4.0.x gave a nameless entry), which
`atp_unpack_test.dart` asserts on and a comment in `atp_source.dart`
describes. A migration with its own tests.

**html is held at `<0.15.7`**, as a ceiling on flutter_html's behalf - pub has
no way to write one except a dependency, which is why `html` is listed without
being imported. A `dependency_overrides` entry would be wrong here: an
override switches version solving off, so the day something requires
`html >=0.15.7` pub resolves happily and the break reappears with nothing
naming the cause. flutter_html 3.0.0, the newest release, reaches into
`package:html/src/query_selector.dart` behind an
`// ignore: implementation_imports` for a top-level `matches(Element, String)`.
0.15.7 deleted it, keeping only a method over a parsed `SelectorGroup`, so the
patch bump fails *compilation* of every test that loads a widget tree:
`Error: Method not found: 'matches'`. Eleven test files could not load.

The lockfile is in this commit because `setup-flutter` passes
`--enforce-lockfile`.

**What no gate on this pull request can tell you.** `ci.yml` has two jobs -
`analyze` and the BSD script suite - and compiles no platform; all five builds
live in `auto-release.yml` on push to `main`. So the green gates below are
evidence about Dart only, and the first compile of this dependency set on any
platform will be the dev build published from the merge. Three bumps deserve a
device after that: `shared_preferences_foundation` 2.6.0 reimplemented Apple
persistence on Pigeon FFI and 18 files in `lib/` read settings through it;
`firebase_core` 4.15.2 rewrote both native implementations and now applies
`kotlin-android` itself, which resolves only because `settings.gradle.kts`
declares the Kotlin plugin; `geolocator_apple` 2.4.1 throws
`PositionUpdateException` where the future used to hang - both call sites are
under `guarded` or a `try`, so that one is a hang becoming a logged failure.

Also not coverable from Windows: `ios/Podfile.lock` and `macos/Podfile.lock`
both still name firebase_core 4.11.0 and firebase_messaging 16.4.1, and the
Firebase iOS SDK moves 12.15.0 -> 12.19.3. Nothing gates them - `flutter build
ios` runs `pod install` itself and rewrites the lock on the runner - and every
bumped podspec keeps its deployment target. Regenerating needs a Mac rather
than a hand-edit, whose SPEC CHECKSUMS cannot be computed here.

Gates: flutter analyze clean, 2530 tests green (2523 before, 4 skipped),
check_format clean over 618 files.

* Take the second wave of dependency majors, and map what blocks the rest

Four majors, and the reason the other four are not here is worth more than the
four that are: **this repository's own submodules cap what the app can
resolve**, and I had the order backwards when I planned these waves.

Taken:

  flutter_map   7.0.2  -> 8.3.2
  latlong2      0.9.1  -> 0.10.1
  pasteboard    0.5.0  -> 0.6.0
  share_plus    10.1.4 -> 12.0.2

`flutter_map` 8 and `latlong2` 0.10 needed no code change at all. 8.0.0's
`Point` -> `Offset` rename and its deprecation of `TileLayer.tileSize` both
miss this app, which touches neither. Its headline - "infinite worlds" - is
less of a change here than it reads: `MapOptions.cameraConstraint` defaulted to
`unconstrained()` in 7.0.2 as well, so panning limits are unchanged; what is
new is that the world repeats at the horizontal edges instead of ending in
blank space, and that layers may cross the anti-meridian. `latlong2` 0.10
changes `LatLng.hashCode`, which nothing here keys a collection on.

`share_plus` 12 replaces `Share.shareXFiles` with
`SharePlus.instance.share(ShareParams(...))` - one call site, and the migration
turned up something the old call had been getting wrong:

`XFile(path, name: ...)` discards `name` off the web. `cross_file`'s io
constructor stores no name at all and `XFile.name` always returns the path's
last segment; its own doc says the parameter "exists only to match the web
version of the constructor". So the `displayName` this app threaded through
`shareRemoteFile` never reached the share sheet on Android, iOS or macOS. It
was latent rather than broken, because `_downloadToCache` writes the temp file
under `basename(remotePath)`, so the name being discarded equalled the one
`XFile` computed. `ShareParams.fileNameOverrides`, new in share_plus 11, is the
supported way to say it, and now says it - which also holds for a caller whose
local path and display name do not agree.

`universal_ble` moved 3.2.0 -> 3.3.0 on `flipperlib`'s own constraint, not
ours: Apple service discovery when a peripheral exposes two services with one
UUID, and an opt-out for iOS central state restoration. No API change.

## Why the other four are not here

**The win32 5 -> 6 chain is one atomic bump of four packages, and our own
submodule gates it.** `package_info_plus` >=10.1.0, `device_info_plus` 13 and
`share_plus` >=13.1.0 all require `win32 ^6.0.1`; `file_picker` 8.x and
`device_info_plus` 11.x both pin `win32 ^5`. So none of them can move alone.
Resolving it told me, in three attempts:

  share_plus >=13.1.0 needs win32 ^6.0.1, device_info_plus 11.x needs ^5.11.0
  package_info_plus >=10.1.0 needs win32 ^6.0.1, file_picker 8.x needs ^5.5.1
  device_info_plus ^13 is forbidden by super_native_extensions *from path*,
    which pins device_info_plus ">=10.0.1 <12.0.0"

That last line is the point. `lib/modules/extensions` is our own fork
(`DarkFlippers/super_native_extensions`, branch `qunleashed`), and upstream has
already widened the same constraint to `<14.0.0` in 0.10.0-dev. Its use of the
package is three lines - `DeviceInfoPlugin().deviceInfo`,
`is AndroidDeviceInfo`, `version.sdkInt <= 30` - none of which changed in 12 or
13, whose only breaking change each was the win32 bump itself. Widening it
locally does unlock the chain; I measured that before reverting it. But it is a
pull request in another repository plus a submodule bump here, and the chain it
unlocks ends at `file_picker` 13 - the single riskiest item in this plan, where
`folder_pick.dart` reaches into the plugin's private channel and its own
comment warns that a major which renames it leaves the failures invisible
(#353). So the whole chain belongs with that migration, not with a wave of
cheap majors.

**`geolocator` is capped at 14.0.2 by a submodule too, and 14 buys nothing.**
14.0.3 pulls in `geolocator_linux`, which needs `dbus ^0.7.3`, while
`flipperlib` pins `dbus ^0.8.0`. Below that cap there is no reason to move:
geolocator 14.0.0's only breaking change is a Flutter floor of 3.29, and this
project pins 3.47.1. Taking 14.0.2 would mean a third held ceiling in this
pubspec in exchange for no API change and an untestable `geolocator_android`
4 -> 5 jump, so it is simply not taken.

**`window_manager` 0.6.0 is a rewrite, not a bump.** The package is now built
on `nativeapi`: one C++ core replaces the per-platform plugin code, and with it
"the changes `MainFlutterWindow.swift`, `my_application.cc` and the Windows
runner used to need" are gone - `linux/runner/my_application.cc` still makes
them here. The 0.5.x API survives in `package:window_manager/legacy.dart`, but
every member of it carries `@Deprecated`, and infos are fatal in this CI, so
the one-import bridge would light up all 14 call sites. 3 Dart files plus a
native runner I cannot compile for macOS or Linux from here, on the platform
set no pull request builds: its own branch.

Gates: flutter analyze clean, 2530 tests green, check_format clean.

No CHANGELOG entry. The only user-visible difference is the map's horizontal
edges, which is the package's new default rather than something this app set
out to change; `docs/releasing.md` leaves that judgement here, and it does not
read as a line somebody would install the build for.

* Write the release notes these three pull requests owed

#490, #491 and #492 all reached a merge decision with no `CHANGELOG.md`
bullet, and in each case the decision was mine and wrong. I reasoned from
`docs/releasing.md`'s note that most pull requests correctly add none - a CI
fix, a Crowdin sync, a submodule bump - and filed all three under it on the
strength of the word "dependencies" without asking what the dependencies
actually changed for somebody using the app. Two of them carry a freeze and a
hang.

The bullets, and why each earns one:

**The iOS 27 freeze** is the one that should never have been left out.
`permission_handler_apple` 9.6.4 fixes a deadlock where
`Permission.notification.status` never returned, because the plugin waited for
the answer with a semaphore on the main thread.
`services/permissions/probes.dart` calls exactly that, `PermissionCenter`
refreshes every probe from `bootstrapAmbientServices`, and the probe's own
contract says it "runs on every resume". A main-thread semaphore blocks the
platform thread regardless of what Dart does with the future, so this froze
the app at launch and on every resume on iOS 27.

**The location hang** is two fixes in `geolocator_apple` 2.4.1 and 2.4.3, both
of `getCurrentPosition` never completing: once when Core Location cannot place
the device and keeps retrying, once when a second call replaced the pending
call's handlers. `GeolocatorGpsProvider.current()` is what answers the
Flipper's location request over RPC, so the symptom was a request the device
never got an answer to - and `_onLocationRequest` is under `guarded`, so the
hang was silent rather than logged.

**The iOS location prompt** named FlipperMap, which users read before granting.

**The map edges** and **the App Bundle** are smaller, and included because the
file is the release notes rather than a log of what was hard.

Deliberately left out, so the next reader does not have to re-derive it:

- The share-sheet filename. `XFile(name:)` was discarded off the web, but
  `_downloadToCache` writes the temp file under `basename(remotePath)`, so the
  name it dropped equalled the one it computed and nobody saw a wrong name.
  Fixed in #492, invisible, no bullet.
- `universal_ble` 3.3.0's fix for a peripheral exposing two services with one
  UUID. Real, but I cannot establish that a Flipper's GATT database does that,
  and a bullet claiming a user saw it would be a guess.
- `firebase_messaging`'s new `deniedPermanently` status, which #492 folds into
  `denied` precisely to keep behaviour identical. Nothing changed to report.

`check_changelog.sh` passes, and says in its own comments that it will never
gate presence - so it was never going to catch any of this.

* Bump extensions past the ceiling it was putting on this app

`lib/modules/extensions` 48558d0 -> 059a6db, which is
`DarkFlippers/super_native_extensions#1`: `device_info_plus` widened from
`">=10.0.1 <12.0.0"` to `">=10.0.1 <14.0.0"` in `super_native_extensions` and
`super_context_menu`, the range upstream itself reached in 0.10.0-dev.2.

**Nothing resolves differently.** `flutter pub get --enforce-lockfile` exits 0
and `pubspec.lock` is byte-identical, because 11.5.0 still satisfies the wider
range. This commit removes a ceiling and takes nothing, which is the whole
point of doing it on its own: the bump that uses the headroom is a different
change with a different risk.

The ceiling was ours. Wave 2 could not take the win32 5 -> 6 chain -
`package_info_plus` >=10.1.0, `share_plus` >=13.1.0 and `device_info_plus` 13
all need `win32 ^6.0.1`, while `file_picker` 8.x and `device_info_plus` 11.x
pin `win32 ^5`, so none of the four moves alone - and the resolver named a
submodule, not a package on pub, as what forbade the only release on the
win32 6 side. Its entire use of `device_info_plus` is three members, in two
files, and none of them changed in 12 or 13.

**What still blocks the chain, and it is not Dart.** `device_info_plus` 12.0.0
also raised the Android build floor to AGP 8.12.1, Gradle 8.13 and Kotlin
2.2.0. `android/settings.gradle.kts` pins AGP **8.11.1**, which is below it;
Gradle 8.14 and Kotlin 2.2.20 are above. iOS 15 and macOS 12 clear 13.0.0's
13.0 and 10.15, and `AndroidDeviceInfo.serialNumber`, which 12.0.0 removed, is
read nowhere here. So the remaining prerequisite is an AGP bump, and neither
the submodule's CI nor `ci.yml` builds an Android app to catch it.

**What the submodule's CI proved, and what it did not.** Its `Flutter` job
passed: it resolved `device_info_plus` 13.3.0 and ran format, analyze and test
over both packages, which is the whole of what that change can affect. All six
`Rust` jobs were red, none of them for a reason this change could reach:
Windows failed `cargo clippy -- -D warnings` on untouched Rust (seven
`double_must_use` errors raised inside `#[async_trait]`'s own expansion, one
`collapsible_match` in `win32/data_object.rs`), both macOS jobs were cancelled
without ever being given a runner, and Ubuntu spent 66 minutes failing to
resolve `azure.archive.ubuntu.com` in `apt-get install libgtk-3-dev`. That
workflow runs `rustup default stable|nightly` with no pinned toolchain, so
`-D warnings` adopts every lint each new clippy adds; this pull request was the
first time it had ever run on that fork, so it had no green baseline to lose.

Fixing those lints there is its own task, and not a lockfile line: the
`double_must_use` fix landed in `async-trait` 0.1.92, which requires `syn ^3`,
while that lockfile holds syn 1.0.109 and 2.0.65 - a new dependency tree in a
repository that ships precompiled native binaries, rather than a bumped pin.

Gates here: `flutter pub get --enforce-lockfile` clean, `flutter analyze`
clean, 2530 tests green, `check_format.sh` clean.

* Keep a tile source's hang-up visible, which flutter_map 8 hid

Found by the review of this pull request, and caused by it: the `flutter_map`
7 -> 8 bump in `dc138046` silently retires the map's "source is not answering"
notice for one failure, and it is the failure this map was configured around.

flutter_map 8 decides a failed tile request was its own doing by looking for
the words `closed` or `cancel` in a `ClientException`'s message, and answers
with a transparent tile instead of reporting it - the `on ClientException`
branch of `tile_provider/network/image_provider/image_provider.dart`. dart:io
spells a server that hangs up mid-response in exactly those words
(`Connection closed before full header was received`), and `IOClient` passes
the message through untouched. flutter_map 7 rethrew every exception at that
point, which is how `errorTileCallback` -> `_reportTileFailure` ->
`mapSourceNotAnswering` worked at all. After the bump that path is dead for a
dropped connection: no callback, no count, no notice, nothing logged - blank
squares, and nothing telling the user the source is the reason or that Map
settings is where to change it.

`TileHttpClient` renames that one exception, and nothing else. Two things make
the rename safe rather than a guess, and both are checked rather than assumed:
a tile aborted because a layer was disposed arrives as
`RequestAbortedException`, caught a branch earlier, and `NetworkTileProvider`
closes only a client it created itself - `dispose` tests
`_isInternallyCreatedClient` and ours is passed in. So every `closed` that
reaches the heuristic is the server's.

It renames rather than wraps because the trigger words are inside the original
sentence, so quoting it would keep the error swallowed. Nothing is lost: the
old path reported this failure as a count, never as text. It deliberately logs
nothing - one dropped tile is ordinary and a dead source drops a screenful at
a time, which is how a single loop has drowned real errors in Sentry before.

A hang-up during the body arrives on the response stream rather than from
`send`, because flutter_map reads the body itself with
`consolidateStreamedResponseBytes`, so both are covered. Timeouts, refusals
and DNS failures never needed any of this: `IOClient` turns a
`SocketException` into a message that says `timed out` or `refused`, which the
heuristic does not match, and those still raise the notice as before.

Nine tests, and they fail for the reason they claim: with the new message
mutated to keep the word `closed`, exactly the three that assert the heuristic
no longer matches go red.

Gates: flutter analyze clean, 2543 tests green, check_format clean.

* Report what the share sheet actually did

Three findings from the review of this pull request, all in the one call site
the share_plus 12 migration touched.

**A dismissal was reported as a success.** `share` reports both a cancelled
sheet and a missing result by *returning* - `ShareResultStatus.dismissed` and
`unavailable` - not by throwing, so the `catch` could not tell either from a
share that went out, and the call awaited the result only for sequencing. So
tapping outside the sheet, backing out of a Mail draft, or double-tapping
Share on Android (the plugin answers `unavailable` to a second call while one
is pending, so one tap gets two toasts) all said "Shared". Now an exhaustive
switch answers each: a success as before, a dismissal with only the clipboard
line if there was one, and `unavailable` with nothing claimed. Pre-existing -
`Share.shareXFiles` returned the same `ShareResult` and it was thrown away too
- but this commit's predecessor rewrote that exact expression, and the return
value is the new API's headline.

**A failure on a page the user had left was reported nowhere.** The file
carried no logging import at all: every arm reported through
`context.showNotification` behind `context.mounted`, and the share sheet is
exactly where a user wanders off. So a `FileUriExposedException` - a path
outside the Android file provider, a packaging bug on our side - or the
`ArgumentError` that `ShareParams` validates with reached no log in any build.
`LogService.caught` now runs before the `mounted` check. `caught` and not
`warn` because the share failing is worth keeping and not worth alerting on,
and `caught_budget_test.dart` rises to 24 with both sites named, as that
ledger asks.

**`fileNameOverrides` never reached a device, and the comment claimed it did.**
`MethodChannelShare._getFile` returns the file untouched the moment
`file.path.isNotEmpty`, reading `nameOverride` only where it builds a temp file
from bytes, and `_toPlatformMap` sends only `paths` and `mimeTypes` - no names
cross the channel. Android, iOS and macOS all go through that class
(`SharePlatform.instance` is `MethodChannelShare`; only Linux and Windows
declare a `dartPluginClass`, and `isShareSupported` excludes them). So the
parameter was dead on arrival, exactly as `XFile(name:)` was before it, and
deleting it changes nothing on any platform - which is also why no test caught
the claim.

The whole `displayName` thread goes with it, because nothing could honour it:
what the receiving app shows is the path's last segment, and that is already
the right name at every caller - `shareRemoteFile` shares what
`_downloadToCache` wrote under `basename(remotePath)`, and the key sheet
shares the key's own file. Threading `ArchiveKey.name` was in fact the wrong
argument: it is the name *without* the extension, so a caller who got their
wish would have shared `MyCard` instead of `MyCard.nfc`. The comment now says
where the name comes from and what it would take to choose one.

`ShareRemoteFileTile` and `ShareLocalFileTile` go too. Neither is referenced
anywhere in `lib/`, `test/` or `tool/`, and they were the only other holders
of `displayName`.

Gates: flutter analyze clean, 2543 tests green, check_format clean. The share
sheet itself is not exercised by any test - `isShareSupported` reads
`io.Platform`, which answers Windows on this host, so the branch is
unreachable from a host test. That gap, and what it would take to close it, is
in the pull request.

* Correct what this pull request's own comments got wrong

The review read every factual claim in the comments this branch adds against
the packages on disk. Three were wrong, one promise was unenforced, and two
user-facing changes had no release note. The ceilings themselves hold - the
`archive` decode table was re-measured, cell by cell, on all three versions
and came back unchanged, which is worth recording after an earlier version of
that same comment was wrong.

**`push_service.dart` cited the wrong package.** The comment said
`deniedPermanently` folds into `denied` "for the reason `probes.dart` gives
for folding `permission_handler`'s own `permanently_denied`". The fold whose
sentence is quoted is on `NotificationPermission.permanently_denied`, which is
**flutter_foreground_task**'s enum; `permission_handler`'s `permanentlyDenied`
is folded a few lines below, for a different stated reason - there it is the
only refusal that plugin reports unambiguously. The comment now points at the
enum's own doc, which is where the rationale actually lives, and names both
sibling folds correctly.

**"Preserves behaviour exactly" said more than it could.** It preserves the
value this function returns - the Android plugin answers 3 where 16.4.1
answered 0, and 0 was already `denied` - but not what the app knows: plain
`denied` now means the OS may still prompt, and that difference is what the
fold discards. Said that way round.

**The promise about `default` was unenforced, and a second reader did not keep
it.** "There is deliberately no `default`: the next status the plugin adds
should break the build" was one edit from being void - replace the
`notDetermined` arm with `_` and `flutter analyze` is clean, the table test is
green (it compares its own table against `AuthorizationStatus.values` and
never looks at the switch), and the format gate is clean. Measured, not
assumed: with that mutation in place the only thing that goes red is the new
`push_outcome_switch_guard_test.dart`, which parses the method and rejects a
wildcard arm or a switch statement. And `_apnsReady`, thirty lines down, read
the same enum with a pair of `!=` and folded anything new into "not
authorised" - it now asks `outcomeOf(status) != granted`, the same question
through the exhaustive switch.

**`firebase_messaging` named a floor this code does not compile against.** The
constraint stayed `^16.4.1` while `push_service.dart` switches on
`AuthorizationStatus.deniedPermanently`, which arrives with
`firebase_messaging_platform_interface` 4.10.0. Not a break - 16.4.1 allows
that interface, `^4.9.0`, and a re-resolve would pull 4.11.1 - but the
declared floor was not one that builds, and this file documents its other
load-bearing floors carefully. `^16.7.1`, with the reason.

**The `archive` comment's "common subject" covered three of eight.** Only
three of 4.6.0's eight breaking lines are the `throwOnError`/`verify`
contract; the rest are `CompressionType` gaining `lzma`/`xz`, zip
`lastModTime` in seconds since epoch, `lastModDateTime` becoming local,
`OutputStream` growing `writeRange`/`reserve`/`readInto`, and
`extractFileToDisk` moving its callback - and the migration has to budget for
those too. Also: the table is dart:io's and the web decoders report damage it
misses, so it now says so; `decodeStream` answers `false` for a *truncated*
stream but still throws for a *corrupted* one, so the gate it makes buildable
has to read both; and the nameless `ZipDecoder` entry is what 4.5.x gives as
well, not only 4.0.x, which matters because 4.5.2 is what this branch
resolves.

**The `html` comment gave a reason that was not the reason.** "The only way
pub lets one be written is a dependency" is not true - `dependency_overrides`
can pin a version just as well, and this pubspec already has such a block, so
the next maintainer to hit a conflict would reach for it. The real reason is
that an override opts the package out of version solving, so a later
`flutter_html` requiring 0.15.7+ would be handed 0.15.6 in silence rather than
failing to resolve. A constraint keeps the conflict visible.

**Two release notes were missing**, both found by reading what moved rather
than the diff. `geolocator_apple` 2.4.2 reads the location permission status
off the main thread in `checkPermission`, which had frozen the app for seconds
while the system location service took its time - and `probes.dart:145` calls
exactly that, at launch and on every resume, beside the notification probe
this branch already has a note for. And `flutter_map` 8 enables arrow-key
panning by default (`KeyboardOptions.enableArrowKeysPanning`), which this app
takes because it sets no `interactionOptions`.

**One test gap closed.** The per-entry cases in `push_denied_cause_test.dart`
take both their name and their expectation from the same table literal, so
moving a row relabels the test and stays green; `warrantsNotice` restates only
the denied/not-denied bit, which cannot tell `granted` from `unknown`. The
mapping is now written out a second time over `AuthorizationStatus.values`.
The `toSet()` on both sides of the coverage assertion got a note too - the
table's order and the enum's differ, and `matcher` compares a `Set`
expectation unordered where an `Iterable` one is pairwise, so `toList()` would
fail today for a reason unrelated to coverage.

Gates: flutter analyze clean, 2543 tests green, check_format clean,
check_changelog OK, `flutter pub get --enforce-lockfile` clean with
`pubspec.lock` unchanged.

* Take the cleanup pass over the two fixes above

Four quality reviewers over the branch diff. Two of their findings changed a
decision rather than tidying one, so they lead.

**The switch guard is gone, because it guarded the mechanism and not the
outcome.** `push_outcome_switch_guard_test.dart` parsed `outcomeOf` and
rejected a wildcard arm, on the grounds that nothing else enforced the doc
comment's promise. It is true that adding `_ =>` leaves everything green
today. But the harm the guard named - a status the plugin adds later folding
into something plausible, so a user who refused notifications is told nothing
- cannot actually ship: `push_denied_cause_test.dart`'s written-out mapping
builds its map over `AuthorizationStatus.values`, so a new status fails it
whether or not the switch still has a wildcard. The guard bought failing at
compile time instead of at test time, and paid for it with blind spots -
`AuthorizationStatus.denied || _ =>` evaded all three of its assertions, and
parsing unresolved source it could not even know the switch was over that
enum. ADR 0004 asks a ratchet to measure the thing that is wrong rather than a
proxy for it, and this one measured a token. Its reasoning is now a paragraph
in `outcomeOf`'s doc and in the test that does the work.

**A guard went in where the fragility actually is.** `TileHttpClient` depends
on a string literal inside another package's private file, and `pubspec.yaml`
takes `flutter_map: ^8.3.2` - so a later 8.x that widened that condition would
silently un-fix the map, and `map_tile_client_test.dart` would not notice,
because it tests the wrapper against *our own* copy of the heuristic.
`flutter_map_tile_error_guard_test.dart` resolves flutter_map through
`.dart_tool/package_config.json` and asserts the branch still reads `closed`
and `cancel`, failing with instructions when it does not. A `<8.4.0` ceiling
was the alternative and is the weaker trade: it would hold back 8.4's fixes
too, where the guard lets the bump through and speaks up only if the premise
is gone. Checked by mutation: pointed at `on MutantException` it fails and
names the file in the pub cache.

**The tile client is now closed.** It never was - `NetworkTileProvider` closes
only a client it created itself, `_providerFor` overwrote the field, and
`dispose` did not touch it, so each tile-source switch and each page close
abandoned an `HttpClient` and up to six keep-alive sockets per host until the
30-second idle timeout. Pre-existing, but worth fixing here because this
branch is what makes the naive fix dangerous: `IOClient.close()` is
`HttpClient.close(force: true)`, so closing fails every request in flight with
a message containing `closed`, which this branch renames and therefore counts
- and eight failures inside five seconds raise "source is not answering". A
pan has dozens in flight, so closing on a source switch would announce that
the source the user just left is dead. `dispose` only, where the layer has
already turned pending tiles into `RequestAbortedException`, and the reason is
written next to both halves.

The rest is tidying:

- `tileHttpClient()` builds the whole stack in `tile_http_client.dart`, next to
  the comment explaining why the wrapper has to be outermost. `page.dart`
  drops three transport imports it held for eleven lines.
- `onError` takes `test: readsAsAborted`, the same gate the stream handler
  already used, so `renamed` no longer carries a second opinion about whether
  to rename - a branch that would have gone dead silently the first time
  someone added that argument.
- The share sheet's three switch arms become one `showNotification` through a
  switch *expression*: `dismissed` and `unavailable` had byte-identical
  five-line tails, and only the latter is worth a log line, which now sits
  above the `mounted` check where it belongs. A new `ShareResultStatus` still
  breaks the build.
- `_downloadToCache` says in one line that the name it writes under is the name
  a share sheet shows, which is where someone looking to change it will be.
- `push_denied_cause_test.dart` loses the enum-coverage assertion, which the
  written-out mapping subsumes exactly, and states `warrantsNotice` as one
  `unorderedEquals` rather than a fourth copy of the status list -
  `permission_notice_test.dart` already pins that predicate per outcome.
- `map_tile_client_test.dart` merges the two halves of one claim into a single
  loop over a named list, so a message cannot be added to one half only.

Skipped, deliberately: `MockClient` from `package:http/testing.dart` for the
three fakes (break-even at best - the named classes carry the doc comments
that say why two failure shapes exist); a shared `readSourceOrFail` in
`source_files.dart` (a real fourth copy of that idiom, but the other three are
in files this branch does not touch); and collapsing the status table and its
five named tests into the written-out mapping, which is sound - every
per-entry failure is also one of its failures - but trades test names that
localise a break for one map diff.

Gates: flutter analyze clean, 2539 tests green, check_format clean. The test
count falls because a redundant guard and a subsumed assertion left and one
pair of tests merged.
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