Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ending an already ended session #2185

Merged
merged 2 commits into from
Sep 5, 2024

Commits on Aug 27, 2024

  1. fix ending an already ended session

    # What
    Fixes an issue where invalid REST API requests were made to both
    outcomes/measure and User updates with session_time were bing made in
    the background. This is only present when location sharing is enabled
    in the SDK (in addition to the app and end-user allowing it) and the
    end-user opens the app at any point after receiving a notification.
    This resulted in 400 errors in the outcomes/measure case and no-op User
    updates that wasting resources, the later doesn't depend on receiving
    notifications. The outcomes/measure is also additive as the bad
    requests are cached and retried on app open.
    
    # How
    Add a state check to SessionService to prevent ending an already ended
    session.
    
    Also address a previous session never ending correctly when the app is
    cold started.
    
    Lastly, added comments pointing out the caveats of IBackgroundService
    to help prevent future wrong assumptions about when backgroundRun() is
    run.
    
    # Follow up
    Since there are cached invalid outcomes/measure requests a migration
    needs to be created in the SDK to remove them for apps who were
    affected by the bug.
    jkasten2 committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    3d3c5f2 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. migration cleaning up invalid cached outcomes

    Clean up invalid cached os__session_duration outcome records
    with zero session_time produced in SDK versions 5.1.15 to 5.1.20 so we
    stop sending these requests to the backend.
    jkasten2 committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    1ab8dcc View commit details
    Browse the repository at this point in the history