diff --git a/CHANGELOG.md b/CHANGELOG.md index 27a07a8a..91bea0ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,8 +34,9 @@ Minor version. Read the install change below before upgrading. ### Fixed - Expo: an app without `expo-router` can now bundle `@datalyr/react-native/expo`. The entry's lazy `require('expo-router')` had no try/catch, so Metro could not treat it as optional and stopped with `Unable to resolve module expo-router` (also in 1.8.0). Now only `useDatalyrScreenTracking()` needs expo-router, and without it the hook throws a clear error. -- iOS: events that carry the IDFA no longer get stuck when the user turns tracking off. The SDK chose `tracking.datalyr.com` (the privacy manifest's tracking domain) from the IDFA saved when the event was built; iOS blocks that host whenever tracking is not authorized at send time, so an event queued while tracking was allowed and sent after it was turned off failed as a network error and held every later event from the device. The host is now chosen when the event is sent, from the live ATT status: the tracking host only with an IDFA and status `authorized`; otherwise the normal host, with `idfa` and `alart` removed and `att_status` / `advertiser_tracking_enabled` set to the status at send time. If the tracking host fails with a network error twice in a row for one event, that event is also tried on the normal host without its IDFA, so it cannot hold the queue. Android is unchanged. -- iOS: in the launch where the user allows tracking, events are no longer sent to a host iOS still blocks. iOS opens `tracking.datalyr.com` only to app launches that start after tracking was allowed. The SDK now uses that host only when tracking was already allowed when the app started; until the next launch, events go to the normal host at once, without the IDFA (`att_status` still reads 3). On the next launch the SDK sends `$att_status` once (`resent: true`) with the IDFA, under one fixed event id per grant, so a kill during that launch cannot count it twice. `alart` without an IDFA follows the same rule: tracking host or removed, never on the normal host. The tracking host now counts as failing on an HTTP error too, not only on a network error. After two failures in a row the event goes to the normal host without the IDFA, and other IDFA events then skip the tracking host for 10 minutes instead of failing twice each. +- iOS: the SDK now chooses the host for each event when it sends it, not when it builds it. An event goes to `tracking.datalyr.com` (the tracking domain in the SDK's privacy manifest) only when it carries the advertising id (IDFA) and tracking is allowed at send time (and was already allowed when the app started; see the next point). Otherwise it goes to the normal host, with `idfa` and `alart` removed and `att_status` / `advertiser_tracking_enabled` set to the status at send time. If the tracking host cannot be reached or answers an HTTP error twice in a row for one event, that event is sent to the normal host without its IDFA, and other IDFA events then skip the tracking host for 10 minutes. So an event built while tracking was allowed can no longer hold the queue after tracking is turned off. Android is unchanged. +- iOS: after the user allows tracking, the advertising id is sent from the next app launch. In the launch where the user taps Allow, events go to the normal host at once without it (`att_status` still reads 3). On the next launch the SDK sends `$att_status` once (`resent: true`) with the IDFA, under one fixed event id per grant, so a kill during that launch cannot count it twice. `alart` without an IDFA follows the same rule: tracking host or removed, never on the normal host. +- Why: in apps where iOS enforces tracking domains, requests to `tracking.datalyr.com` are refused until tracking is allowed and the app has started again. iOS enforces the list in the app's Info.plist. Xcode copies an SDK's list there for a Swift package. It does not copy this SDK's list, which CocoaPods installs as a resource bundle. So in a React Native or Expo app the host is refused only if the app lists it in its own Info.plist. The rules above deliver events in both cases. - Events are no longer dead-lettered by a server outage. A 5xx (503 included), 429, 408, a timeout or a network error keeps the event in the queue with the same `eventId`, uses none of its retry budget, and backs the whole queue off (5 s doubling to 5 minutes with 0.5x to 1.0x jitter; never sooner than the server's `Retry-After`, honoured up to 10 minutes, plus 0 to 25% jitter). Before, three failed flushes (about 1 to 2 minutes of 5xx or 429) moved events to the dead-letter store, and a timeout (`Aborted`) was not recognised as a connectivity failure. - `Retry-After` is now honoured on 5xx answers (ingest answers 503 with `Retry-After` when the fault is its own), not only on 429 and 408. A `Retry-After` longer than 30 s is no longer cut short in-request. - Any 2xx is a delivered event, whatever its body. Ingest answers 204 with no body for a filtered event; that used to count as a failed send and re-send the event.