Page MenuHomePhabricator

Investigate integrating MEP library in iOS
Closed, ResolvedPublic


The initial client PR has two pieces needed for us to connect this end-to-end: implementation of the NetworkManager protocol and implementation of the StorageManager protocol. The expected functionality of these is defined well in the EventPlatformClientProtocols.swift file in the initial PR.

This task is to investigate and subtask out if necessary the implementation of these portions. If possible I think it would be nice to lean on existing functionality in the old event logging system for persistence and networking rather than reinventing the wheel. Analytics has confirmed that the design of NetworkManager and StorageManager can be changed if needed for this. If we can reuse some components from the old system, maybe we should duplicate that code so that the original event logging library remains untouched for better regression testing.

If it's not reusable, we should have a solid understanding of how the old system works and document any deltas to be aware of with how things are stored and the network is used in the old system vs. the new system.

Event Timeline

Moving this to waiting - work will be done against subtasks.

Besides being disabled when the app enters background (loggingEnabled = false) should also be disabled if user isn't sharing usage data with us. Right now that's not taken into consideration by the library directly, but perhaps it should (just like how existing EventLogging respects that setting).

@Tsevener: What do you think about StorageManager having a sharingUsageData property that can be accessed in EPC's log() (like how it accesses deviceID)? We could then perform a check either at the top of log() (so the event doesn't even make it into the input buffer if the user is opted out) or at the bottom, right before the event is given to NetworkManager for POSTing.

@mpopov sure sounds good, I'll make that change.

@mpopov PR has been updated - ready for your end-to-end testing & review of my stuff! Then we'll take it back and have one of the other engineers review. We should also pick a feature to convert at that time. Also I noticed some deltas with the old library as I was using some of that logic. I documented them in the task description here in case you have any input on that. At the very least it could explain some discrepancies we see once this goes out.

Congrats on taking step 1 with us y'all!