Skip to content

Conversation

samsymons
Copy link
Collaborator

@samsymons samsymons commented Oct 16, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1199333091098016/task/1211656286347726?focus=true
Tech Design URL:
CC:

Description

This PR updates the pending wide event logic, simplifying the implementation and also fixing a bug where delayed events weren't sent correctly.

Testing Steps

  1. Check that the new tests cover the logic correctly
  2. Optionally: set up a delayed event situation and verify that the app sends it

Impact and Risks

What could go wrong?

Quality Considerations

Notes to Reviewer


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Replaces callback/queue-based wide event sending with async sendPendingEvents and updates AppDelegate; adds unit tests for purchase/restore flows and feature-flag gating.

  • Wide events:
    • API simplification: Replace resume, sendAbandonedPixels, and sendDelayedPixels with async sendPendingEvents() that processes purchase and restore events (abandoned + delayed) based on feature flags.
    • Call site update: In AppDelegate, switch to Task { await wideEventService.sendPendingEvents() } at launch.
  • Tests:
    • Add WideEventServiceTests.swift covering feature flag gating, purchase/restore happy paths, timeouts, partial data, and entitlement checks.
  • Project:
    • Include WideEventServiceTests.swift in Xcode project and unit test targets.

Written by Cursor Bugbot for commit 5480658. This will update automatically on new commits. Configure here.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the wide event service to simplify the pending event logic by consolidating previously separate functions for abandoned and delayed pixels into a single unified approach, fixing bugs where delayed events weren't sent correctly.

  • Replaced complex queue-based architecture with direct async/await implementation
  • Unified abandoned and delayed pixel processing into a single sendPendingEvents() method
  • Added comprehensive test coverage for the simplified logic

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
WideEventService.swift Simplified pending event logic by removing queue-based approach and consolidating abandoned/delayed processing
WideEventServiceTests.swift Added comprehensive test suite covering feature flag gating, timeout scenarios, and error cases
AppDelegate.swift Updated to use new async sendPendingEvents() method instead of callback-based approach
project.pbxproj Added test file to Xcode project configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@hanyutang-sandra hanyutang-sandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

freemiumDBPScanResultPolling?.startPollingOrObserving()

wideEventService.sendAbandonedPixels { }
Task {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can still move it to utility if want to

Task(priority: .utility)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants