Repository navigation
fix: record installs without a deviceId and report the IANA timezone - #15
Merged
Merged
Conversation
… none The install endpoint accepts a missing deviceId but rejects null, so an install reported without one was refused and treated as organic, and the install was reported again on every launch. DeviceFingerprint.toJson() drops fields with no value, as EventRequest.toJson() does.
The fingerprint read the zone from the timezone package's tz.local, which is only set once the app initializes that package's database. The SDK never does, so the fallback DateTime.now().timeZoneName always ran and sent an abbreviation such as "PDT". The server records a browser click's timezone as an IANA identifier derived from its IP, so the two never matched and the factor never counted toward install attribution. The identifier now comes from the flutter_timezone plugin, falling back to the abbreviation on a platform that can't report one. The timezone package is no longer used and is removed. The declared minimums are raised to Flutter 3.38.1 and Dart 3.10, which the existing dependencies already require.
Raising the Dart minimum changes the language version dart format and the code generators target, which reformats existing files. That belongs in a change of its own.
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.
Summary
deviceIdare recorded.DeviceFingerprint.toJson()drops fields with no value, the same wayEventRequest.toJson()does. The install endpoint accepts a missingdeviceIdbut rejectsnull, so an app that didn't pass one had every install refused and treated as organic, and deferred deep links were never delivered.flutter_timezone, falling back to the abbreviation when the platform can't report one. The server records a browser click's timezone as an IANA identifier, so an abbreviation such asPDTnever matched it and the factor never counted toward attribution.flutter_timezonereplaces thetimezonepackage, which is removed.pubspec.yamlandSdkInfo.version.Test plan
flutter test: 141 passing (3 new:deviceIdomitted when null; IANA identifier from the platform; fallback when the platform can't answer)flutter analyze: no issuesonDeepLink, registered afterinitialize(), receives the launch link with resolved data/installreturns 200,attributed: true, confidence 80, matched onip,platform,timezone,language.onDeferredDeepLinkreceives the link with its URL parameter incustomParameters.