-
Notifications
You must be signed in to change notification settings - Fork 37
Refactor the JobRunner to use actors and be async/await #538
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
base: dev
Are you sure you want to change the base?
Refactor the JobRunner to use actors and be async/await #538
Conversation
• Refactored the JobRunner • Refactored the JobQueue • Refactored the FailedAttachmentDownloadsJob to be async/await • Refactored the FailedMessageSendsJob to be async/await • Removed the `uniqueHashValue` from `Job` (make the `shouldBeUnique` behaviour part of the `DisplayPictureDownloadJob` instead)
…efactor # Conflicts: # Session.xcodeproj/project.pbxproj # Session/Settings/NukeDataModal.swift # SessionMessagingKit/Jobs/AttachmentDownloadJob.swift # SessionMessagingKit/Jobs/AttachmentUploadJob.swift # SessionMessagingKit/Jobs/CheckForAppUpdatesJob.swift # SessionMessagingKit/Jobs/ConfigurationSyncJob.swift # SessionMessagingKit/Jobs/DisplayPictureDownloadJob.swift # SessionMessagingKit/Jobs/ExpirationUpdateJob.swift # SessionMessagingKit/Jobs/GroupInviteMemberJob.swift # SessionMessagingKit/Jobs/MessageReceiveJob.swift # SessionMessagingKit/Jobs/SendReadReceiptsJob.swift # SessionMessagingKit/Jobs/UpdateProfilePictureJob.swift # SessionMessagingKit/Utilities/Profile+CurrentUser.swift # SessionUtilitiesKit/JobRunner/JobRunner.swift # SessionUtilitiesKit/Types/CurrentValueAsyncStream.swift
• Updated `waitUntilInitialised` to have fallback support for iOS 15 • Updated the JobExecutor to allow individual jobs to control their concurrent execution behaviour • Fixed some race conditions in the JobRunner • Fixed some issues with concurrent job running • Fixed some issues where jobs would initialise a Noop version of libSession which could break the users state during this app run
• Updated the code to set the `JobPriorityContext` when entering/leaving a conversation • Updated the MessageReceiveJob to split failed messages into a separate job (keeps the behaviours and logs more consistent) • Updated the Onboarding code to use async/await instead of publishers • Updated the BackgroundPoller to handle the async/await Poller changes • Fixed a couple of issues with the file download sorting • Fixed an issue when setting the file sort data retriever • Fixed an issue where "initial job dependencies" provided when adding a job to the job runner weren't saved to the database • Fixed a few issues where jobs could fail or behave strangely on startup because they were racing initial data loading • Fixed an issue where the home and conversation screens would try to trigger layouts while the app was doing background fetches
• Added a timeout to the background message sending logic
• Updated the logic to allow starting specific job variants during the background period (so dependant jobs work)
• Updated the job filtering logic to allow OR based filters within a category (eg. select jobs where "RUNNING" AND ("messageSend" OR "attachmentUpload")
SessionMessagingKit/Database/Migrations/_002_SUK_SetupStandardJobs.swift
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this migration?
• Made some optimisations to the logging logic • Updated a bunch of group update functions to be async/await • Updated code to use `decodedMessage.sender` everywhere instead of `message.sender` (where available) • Fixed an issue where we would pointlessly try to mutate the contacts config when updating the current users profile info • Fixed an issue where onboarding could fail to save the user to the database due to a query trying to update a non-existent config
ThreadSafelogic from bothuniqueHashValuefromJobshouldBeUniquebehaviour part of theDisplayPictureDownloadJob(since it's only used for that one job)JobExecuterstructure (a number of these will need further refactoring to be fully async/await)