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

Use two Workers to display notification and send receive receipt #1484

Merged
merged 5 commits into from
Nov 13, 2021

Commits on Nov 12, 2021

  1. Revert NotificationWorker back to Worker

    - Reverts `NotificationWorker` from being a `ListenableWorker` back to `Worker`
    - Removed all code related to the ListenableWorker implementation of NotificationWorker
    nan-li committed Nov 12, 2021
    Configuration menu
    Copy the full SHA
    23657fd View commit details
    Browse the repository at this point in the history
  2. Use a Worker with a delay to send Receive Receipts

    - Add a `ReceiveReceiptWorker` to call `sendReceiveReceipt(notificationId)`
    nan-li committed Nov 12, 2021
    Configuration menu
    Copy the full SHA
    6a53b9c View commit details
    Browse the repository at this point in the history
  3. Remove OSDelayTaskController and related code

    - removed OSDelayTaskController.kt since no longer used now that we use Worker with a delay
    - removed MockDelayTaskController.java which is used in unit tests
    - removed other code related to these two classes
    nan-li committed Nov 12, 2021
    Configuration menu
    Copy the full SHA
    8b36886 View commit details
    Browse the repository at this point in the history
  4. Make ReceiveReceiptWorker run with no delay for unit tests

    - unit tests fail when ReceiveReceiptWorker runs with a delay so make no delay for unit tests
    
    - a few unit tests related to sending receive receipts  were failing due to "Main looper has queued unexecuted runnables. This might be the cause of the test failure." even after awaiting a long time (flaky pass/fail)
    
    - removed test `testNotificationReceivedNoSendReceivedRequest_Delay` because no longer testing the delay in unit tests and other receive receipt tests are sufficient
    nan-li committed Nov 12, 2021
    Configuration menu
    Copy the full SHA
    d4458ef View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2021

  1. Don't have NetworkType.CONNECTED constraint for unit tests

    - unit tests sending receive receipts were failing when the ReceiveReceiptWorker has constraint of `setRequiredNetworkType(NetworkType.CONNECTED)`
    
    - they were failing even though a check to `NetworkInfo.isConnected()` returns `true`
    
    - so, refactor `buildConstraints` out of the method `beginEnqueueingWork` so it can be shadowed to return no constraints when building the work request for unit tests
    nan-li committed Nov 13, 2021
    Configuration menu
    Copy the full SHA
    d80b60b View commit details
    Browse the repository at this point in the history