Commit graph

70 commits

Author SHA1 Message Date
Cody Henthorne
92978b0e3f Fix permission crash with new networking check on API<23. 2022-02-02 19:40:22 -05:00
Cody Henthorne
f091502949 Use newer APIs for detecting network changes. 2022-02-02 16:50:58 -05:00
Rashad Sookram
35d0f1fc8c Revert "Fix dynamic language override for app context."
This reverts commit 75a19ada23f4fc0d5111fb74d234c7c6f48ba503.
2022-01-24 12:05:29 -05:00
Rashad Sookram
fd6a2c6b10 Fix dynamic language override for app context.
Fixes #11889
2022-01-24 12:04:48 -05:00
Cody Henthorne
bfdedd57d1
Update jumbomoji processing and downloading. 2022-01-21 10:31:43 -05:00
Brian Moyer
79d73c9e74 Fix WiFi SMS setting.
Fixes #11898
2022-01-18 10:43:38 -05:00
Greyson Parrelli
5c27842a01 Include queue in job logs. 2022-01-03 11:28:10 -05:00
Greyson Parrelli
843ed24bbb
Introduce SignalDatabase as the main database entrypoint. 2021-11-18 12:36:52 -05:00
Greyson Parrelli
51c86cab10 Add the ability to get the current state of a job. 2021-11-12 10:57:01 -04:00
Alex Hart
ca24682366
Fix a bunch UX bugs for donor badges. 2021-11-11 13:46:38 -04:00
Greyson Parrelli
049ba6a706 Remove WorkManager migration that is no longer necessary.
We migrated away from WorkManager over 2 years ago. We needed it at the
time because we wanted to migrate jobs that were scheduled on
WorkManager into the new system. However, at this point, the user's
client would have been expired for 2 years at the point of upgrade, and
there wouldn't be any jobs that need migrating.
2021-11-04 17:00:04 -04:00
Greyson Parrelli
c06fb81490 Render better crash stack traces for executors. 2021-11-04 17:00:04 -04:00
Greyson Parrelli
665d9e31f6 Separate thread updates into a job and other perf improvements. 2021-08-24 16:59:09 -03:00
Cody Henthorne
2830132b24 Reduce time to start PushTextSendJob. 2021-08-03 13:45:30 -03:00
Greyson Parrelli
58b070e6e3 Fix job info log formatting. 2021-06-25 17:25:59 -04:00
Greyson Parrelli
f19033a7a2 Implement the message send log for sender key retries. 2021-06-24 16:36:13 -04:00
Alex Hart
08a3bc457e Fix autodownload constraint. 2021-05-13 12:00:24 -04:00
Greyson Parrelli
31e1c6f7aa Handle 428 rate limiting. 2021-05-05 16:47:13 -04:00
Alex Hart
85e0e74bc6 Add support for OTA emoji download. 2021-05-03 14:02:58 -04:00
Greyson Parrelli
b053fbc4a7 Use Log.tag where appropriate. 2021-03-31 16:02:32 -03:00
Alan Evans
d83c3d35eb Ensure Job factories pass the parameters to their created Jobs. 2021-03-16 10:07:21 -03:00
Cody Henthorne
dc9b8169c0 Make thread related utility methods available for use in all modules. 2021-03-02 11:07:04 -05:00
Greyson Parrelli
8950100bd7
Decrypt and process messages all in one transaction.
Giddy up
2021-02-23 18:34:18 -05:00
Greyson Parrelli
69a1fa0d3c Remove database transaction protections for job manager interactions.
Now that the JobDatabase is a separate physical database, we no longer
have to worry about people enqueuing jobs while in a transaction.
2021-02-20 14:45:36 -05:00
Greyson Parrelli
dda0e0393e Ensure a job has a context before we fail it. 2021-02-11 11:43:21 -05:00
Greyson Parrelli
158f3d898f Fail an enqueued job if its dependencies already failed.
This was a bug that was most notable during the attachment pre-upload
process: if an attachment failed to upload, the subsequently-enqueued
PushMediaSendJob would still send. This is because the attachment jobs
were enqueued first and failed *before* we enqueued the PushMediaSendJob
as a dependency.

This will use the JobTracker to determine if a dependency already failed
at the time of enqueueing a job like this. This isn't perfect, because
the JobTracker is memory-only and has a limited buffer (currently 1000),
but in practice this should be sufficient for our use cases. I imagine
it'd only fall apart if we somehow  enqueued a dependent job *much*
later, or somehow enqueued it based on a job ID that we persisted on
disk through an app restart. We don't do any of these things, currently,
and probably never should.

Also took the opportunity to patch a case where we weren't failing
dependent jobs when canceling a job, since I was giving the failure
stuff a look-over.
2021-02-10 15:21:03 -05:00
AsamK
8f51bdcb78 Adapt maxInstancesForQueue to only consider instances of the same job.
Currently the maxInstancesForQueue limit checks the count of all jobs in a
given queue. If there are already too many jobs, the new job is discarded.

However this is not the expected behavior for the two jobs where it's used:
GroupCallPeekWorkerJob and AutomaticSessionResetJob
For both the expected behavior is that there aren't too many jobs of them
started, but that there will be at least one instance of them started.
Both of them use the same queue as the PushProcessMessageJob and the MarkerJob.
Those two jobs are often in the queue at the same time, effectively preventing
the GroupCallPeekWorkerJob and AutomaticSessionResetJob from being enqueued.
2021-02-08 14:26:59 -05:00
Greyson Parrelli
1d83729e6c Move backoff calculation into jobs. 2021-01-28 18:44:04 -05:00
Alan Evans
b077c9b4f3
Only schedule one job per constraint set. 2021-01-19 17:07:32 -04:00
Greyson Parrelli
8f7fe5c3ee Add jitter to job exponential backoff. 2021-01-16 03:41:29 -05:00
Greyson Parrelli
93e9dd6425 Feature flag the default max backoff interval. 2021-01-16 03:06:54 -05:00
Alex Hart
8724d904b7 Add NotInCallConstraint, restrict auto-download of media and documents when on an active voice or video call. 2021-01-13 19:43:23 -05:00
Greyson Parrelli
01152ead61 Move the JobDatabase to a separate physical database.
Also removes maxInstancesPerFactory from DB, which was only used during job submission and had no need to be persisted.
2021-01-06 17:03:21 -04:00
Greyson Parrelli
cdd7b2deb9 Improve and streamline Application#onCreate. 2021-01-06 17:03:20 -04:00
Greyson Parrelli
9f8e31db78 Change WebsocketDrainedConstraint to DecryptionsDrainedConstraint. 2020-12-08 18:10:04 -05:00
Greyson Parrelli
c3d7b88cf6
Add support for setting max instances per job queue. 2020-12-07 17:30:05 -05:00
Greyson Parrelli
8e93bf9075 Create a core-util module with some common utilities. 2020-12-05 13:44:13 -05:00
Greyson Parrelli
97047bccde Remove job adds from database transactions. 2020-12-05 13:44:13 -05:00
Greyson Parrelli
7868c3094b Make FastJobStorage synchronous again. 2020-12-05 13:44:13 -05:00
Alex Hart
ce44e3949c Add new VIEWED item in RecieptMessage enumeration.
Also includes necessary Database changes for supporting this as well as View-Once receipt support.
2020-11-25 11:37:13 -04:00
Greyson Parrelli
6bb9d27d4e Add the ability to migrate GV1 groups to GV2.
Co-authored-by: Alan Evans <alan@signal.org>
2020-11-04 16:05:35 -04:00
Alex Hart
ee3d7a9a35 Implement new workflow for scoped storage backup selection. 2020-10-15 16:19:17 -04:00
Alan Evans
8de4290c5b Fix can create backups when timed backup is waiting for charging constraint. 2020-10-02 10:32:04 -03:00
Greyson Parrelli
19cc43c442 Add a charging constraint to the backup job. 2020-09-23 16:54:38 -04:00
Greyson Parrelli
7108fc81a9 Prevent redundant JobScheduler jobs.
Some devices actually enforce a scheduling rate, and will crash if you
submit more than, say, 250 jobs in 1 minute. This can happen when
catching up with messages and scheduling a lot of
PushDecryptMessageJobs.

While it'd be tricky to limit jobs with constraints, this just does the
simple thing of not enqueueing unnecessary jobs for constraint-less
jobs.
2020-09-23 16:54:38 -04:00
Greyson Parrelli
e89285a219 Reduce log noise. 2020-09-23 16:54:38 -04:00
Greyson Parrelli
662f0b8fb6
Improve detection of websocket drained status.
Will now work when you lose and regain network. Also removes the
unnecessary InitialMessageRetriever.
2020-07-21 10:38:42 -04:00
Greyson Parrelli
e89655f793 Resolve newly-entered numbers before starting a conversation. 2020-07-19 09:32:16 -04:00
Greyson Parrelli
152578e576 Add reserved job runners for inbound and outbound messages. 2020-06-25 18:14:54 -04:00
Greyson Parrelli
87a59b6a9b Add support for memory-only jobs. 2020-06-25 18:14:54 -04:00