-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix - send analytics even when BTAPIClient deallocated (#1379)
- Move `BTAnalyticsService` from "faux" singleton setup in `BTAPIClient`, to actual singleton - Use protocol abstraction to be able to mock BTAnalyticsService in our tests - Make `RepeatingTimer` and `AnalyticsEventStorage `properties non-static - Refactor `BTAnalyticsService.sendAnalyticsEvent()` method to require single `FPTIBatchData.Event` property vs 12 individual properties --------- Signed-off-by: Jax DesMarais-Leder <[email protected]> Signed-off-by: Rich Herrera <[email protected]>
- Loading branch information
Showing
10 changed files
with
123 additions
and
162 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// Describes a class that batches and sends analytics events. | ||
/// - Note: Specifically created to mock the `BTAnalyticsService` singleton. | ||
protocol AnalyticsSendable: AnyObject { | ||
|
||
func sendAnalyticsEvent(_ event: FPTIBatchData.Event) | ||
func setAPIClient(_ apiClient: BTAPIClient) | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.