The referrer source is behind an interface so the reporting logic is unit
tested without the Play plugin, which needs a real device.
The done-flag is only written after a successful send, so a failed report
retries on the next launch instead of vanishing. A missing referrer still
reports, because an install with no attribution is still an install and the
organic baseline is what paid gets compared against.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uri.splitQueryString throws ArgumentError, not FormatException, for
malformed percent-encoding (e.g. a truncated '%' or invalid escape) --
verified against the project's Dart SDK. The doc comment and Task 3's
brief both promise FormatException so callers can catch a single type
and route it through recordError. Catch the mismatch and rethrow as
FormatException; add a test proving the contract holds.
Pure function, no plugin dependency, so it is fully unit tested. Keeps Play's
organic referrer rather than discarding it -- that is how paid and organic
installs get told apart.
Lets FormatException escape on malformed encoding so the caller can record it
rather than silently losing an install.