wordpress-mobile / wordpress-mobile/WordPress-iOS

[Reader] Make sure the Application Closed event is correctly tracked

Open
#22,811 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

[Type] Bug Analytics Reader
Dominant language
Swift
Stars
3.9k
Forks
1.2k
Avg merge
23h 51m
Merged PRs (30d)
58

Description

We've observed a downtrend in the application_closed event on iOS. Upon investigation at the backend, it appears events are being rejected due to "Event timestamp older than 14 days." This suggests that the app is not sending analytics events upon closing or backgrounding.

Dev notes: We track this event every time the user backgrounds the app, but we also bulk-send queued tracks events when the app is backgrounded. This means, the application_closed event may miss the current batch due to race condition and will only get sent on the next batch—that is, until the timer fires (every 15 seconds while the app is in the foreground) or until the app is backgrounded again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect WordPress/Classes/Utility/Analytics/WPAppAnalytics.m and the referenced TracksService.m batching and timer paths. Trace how application_closed is queued when the app backgrounds and whether it can enter the next batch; done means the event is included in the current background send instead of waiting for a later timer or background transition.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, swift
Domain
analytics, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.