Commit Graph

21 Commits

Author SHA1 Message Date
Nora Trapp
bb59b27958 Avoid duplicate message fetch in NSE 2021-06-16 11:40:06 -07:00
Nora Trapp
b393c00412 Fix NSE 2021-06-16 11:40:06 -07:00
Nora Trapp
9035b8ac8a PR Feedback 2021-06-03 08:38:30 -07:00
Nora Trapp
d54a4c7236 Make sure badge count is updated by NSE 2021-06-03 08:38:29 -07:00
Nora Trapp
f1e4113fb2 Handle call messages in the NSE 2021-06-03 08:38:29 -07:00
Nora Trapp
4e535fa7ef Make database recovery async 2021-04-01 12:50:41 -07:00
Nora Trapp
c40a786050 Fix extensions in post YDB world 2021-03-27 12:13:20 -07:00
Matthew Chen
d0cbf8cfd0 Rework dependency access. 2021-03-25 09:24:27 -03:00
Nora Trapp
ec1a1bb9ae Simplify MessageProcessing promises 2021-02-23 10:45:50 -08:00
Matthew Chen
645bd76bd5 Rework app readiness. 2021-02-04 09:55:39 -03:00
Matthew Chen
ad6bda8a44 Rename singleton accessors. 2020-09-17 21:11:07 -03:00
Nora Trapp
e88903a408 Allow app to be remotely expired 2020-09-08 15:11:03 -07:00
Matthew Chen
516defef39 Remote deprecation. 2020-09-02 16:51:59 -03:00
Matthew Chen
02e812deef Tweak readiness checking. 2020-07-08 15:02:14 -03:00
Matthew Chen
e69db40110 Refine the de-bouncing of group info requests. 2020-07-01 16:55:39 -03:00
Matthew Chen
6b4f192b1b Remove usage of retainUntilComplete. 2020-05-22 09:51:12 -03:00
Nora Trapp
f6216f3c4e PR Feedback 2020-01-30 11:45:11 -08:00
Nora Trapp
97d0ca1b0d Crash if we receive a message in the NSE before we intend to support it. 2020-01-30 11:45:11 -08:00
Nora Trapp
9e182e65f2 Handle received notifications while the app is running. 2020-01-30 11:44:42 -08:00
Nora Trapp
6437730084 Handle the fact that multiple notifications can be processed in the same instance of the NSE 2020-01-30 11:44:42 -08:00
Nora Trapp
88ac10de05 Notification Service Extension
The NSE should only run on iOS 13.3 or later where the "filtering" entitlement
is available since our notifications don't contain any content and will often
not trigger any user visible content. We control this by setting the deployment
target to iOS 13.3.

This does not handle calls as it's currently impossible to wake the main app or
launch CallKit from within the NSE. Should we reach a point where we need to use
this extension in production the service will need to be able to differentiate
between call and non-call messages and deliver them as VOIP or Vanilla pushes as
appropriate. Alternatively, Apple may introduce some way for us to signal the
main app that a call message has been received.

This does not currently address the potential for the NSE and the main app to be
running and trying to process messages at the same time. As long as the
websocket is connected and the main app is processing messages in a timely
fashion the NSE will never be called since the service will not send pushes for
these messages, but censorship circumvention users and users where the websocket
is disconnected for some reason will legitimately receive pushes and we will
want to process those messages. How we will handle these cases requires further
thought since just terminating the NSE when the app launches is not sufficient.
We could potentially do something like terminate the NSE everytime the main app
runs the message fetcher job which should only happen if either the user
pulls-to-refresh on the conversation list or the websocket is actively connected
and receiving messsages. I plan to address this in a follow-up pull request.

Currently this code will not ever be run since the service never sends vanilla
push notifications. Eventually we will need to add logic into the main app to:
a) detect we're on iOS 13.3 or later and b) update a flag on the service telling
it to stop using VOIP pushes for non-call messages. The API for requesting this
from the service does not yet exist.
2020-01-30 11:44:41 -08:00