Commit Graph

50 Commits

Author SHA1 Message Date
Morgan Pretty c77d7ecda1 [WIP] Refactored dependency access to be more generic 2023-09-01 13:40:50 +10:00
Ryan Zhao e4beb5c794 update expiresInSeconds filter to be safe for negative value 2023-08-10 16:17:25 +10:00
Morgan Pretty 63be502434 Merge remote-tracking branch 'upstream/dev' into disappearing-message-redesign
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/Settings/ThreadDisappearingMessagesSettingsViewModel.swift
#	SessionMessagingKit/Configuration.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender.swift
#	SessionSnodeKit/Networking/SnodeAPI.swift
#	SessionTests/Conversations/Settings/ThreadDisappearingMessagesViewModelSpec.swift
#	SessionUtilitiesKit/General/Dictionary+Utilities.swift
#	SessionUtilitiesKit/JobRunner/JobRunner.swift
2023-08-04 09:16:31 +10:00
Morgan Pretty a41f1c1366 Fixed the broken tests
Cleaned up the Dependencies so that tests can run synchronously without having to custom set queues as much
Sorted out the crypto and network dependencies to avoid needing weird dependency inheritance
Fixed the flaky tests so they are no longer flaky
Fixed some unexpected JobRunner behaviours
Updated the CI config to use a local build directory for derivedData (now works with build tweaks)
2023-08-01 14:27:41 +10:00
Morgan Pretty e768bebe6d Merge remote-tracking branch 'upstream/dev' into feature/job-runner-unit-tests
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Meta/Session-Prefix.pch
#	Session/Notifications/SyncPushTokensJob.swift
#	Session/Utilities/BackgroundPoller.swift
#	SessionMessagingKit/Configuration.swift
#	SessionMessagingKit/Database/Models/Profile.swift
#	SessionMessagingKit/Jobs/Types/AttachmentDownloadJob.swift
#	SessionMessagingKit/Jobs/Types/AttachmentUploadJob.swift
#	SessionMessagingKit/Jobs/Types/DisappearingMessagesJob.swift
#	SessionMessagingKit/Jobs/Types/FailedAttachmentDownloadsJob.swift
#	SessionMessagingKit/Jobs/Types/FailedMessageSendsJob.swift
#	SessionMessagingKit/Jobs/Types/GroupLeavingJob.swift
#	SessionMessagingKit/Jobs/Types/MessageReceiveJob.swift
#	SessionMessagingKit/Jobs/Types/MessageSendJob.swift
#	SessionMessagingKit/Jobs/Types/NotifyPushServerJob.swift
#	SessionMessagingKit/Jobs/Types/RetrieveDefaultOpenGroupRoomsJob.swift
#	SessionMessagingKit/Jobs/Types/SendReadReceiptsJob.swift
#	SessionMessagingKit/Jobs/Types/UpdateProfilePictureJob.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/ClosedGroupPoller.swift
#	SessionMessagingKit/Utilities/AppReadiness.m
#	SessionMessagingKitTests/Open Groups/OpenGroupManagerSpec.swift
#	SessionMessagingKitTests/_TestUtilities/TestOnionRequestAPI.swift
#	SessionShareExtension/ShareNavController.swift
#	SessionSnodeKit/Jobs/GetSnodePoolJob.swift
#	SessionUtilitiesKit/Configuration.swift
#	SessionUtilitiesKit/Database/Utilities/Database+Utilities.swift
#	SessionUtilitiesKit/JobRunner/JobRunner.swift
#	SignalUtilitiesKit/Meta/SignalUtilitiesKit.h
#	SignalUtilitiesKit/Utilities/SSKAsserts.h
2023-07-18 10:02:51 +10:00
ryanzhao df7b47da64 make get expiration a job to fix race condtion 2023-07-05 17:17:15 +10:00
Ryan Zhao 1f20403a26 WIP: race condition handling 2023-07-03 17:07:04 +10:00
ryanzhao aace269359 WIP: make job chain of disappearing messages job, expiration update job, and config sync job 2023-07-02 22:57:47 +10:00
Ryan Zhao 754279e6ab make update message expiration a seperate job from disappearing messages job 2023-06-29 16:31:06 +10:00
ryanzhao 5063feeb6a fix an issue where message is not received & minor refactor on disappearing message job 2023-06-28 17:39:38 +10:00
ryanzhao 6658c5edd5 fix issue of syncing disappearing messages 2023-06-02 15:12:51 +10:00
Ryan Zhao dca70058e3 fix disappearing messages config not sync when linking a new device 2023-06-01 17:14:14 +10:00
Ryan Zhao 9dfaa09a95 fix a bug on getting expirations from snode 2023-06-01 15:37:03 +10:00
ryanzhao cd95212918 minor fix 2023-05-31 17:18:31 +10:00
ryanzhao 30e4ad691b further fix 2023-05-31 17:18:04 +10:00
ryanzhao 84452750fe fix disappear after read not synced properly 2023-05-31 17:17:02 +10:00
Ryan Zhao afb456b710 Merge branch 'updated-user-config-handling' into disappearing-message-redesign 2023-05-29 16:37:34 +10:00
ryanzhao 00e468fcce implement the new approach to sync disappearing after read status across devices 2023-05-24 10:17:43 +10:00
ryanzhao 2b85c0fde0 WIP: implement new approach to sync disappearing after read across devices 2023-05-23 17:18:53 +10:00
Morgan Pretty 44824c8127 Added a bunch of logs to the Jobs to better track the startup state 2023-05-23 14:02:12 +10:00
Ryan Zhao b05bb7f9bd fix a crash when the network clock offset is negative 2023-05-22 13:48:25 +10:00
Morgan Pretty be7881ad2e Merge remote-tracking branch 'origin/feature/updated-user-config-handling' into disappearing-message-redesign
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/ConversationVC.swift
#	Session/Conversations/ConversationViewModel.swift
#	Session/Conversations/Settings/ThreadDisappearingMessagesSettingsViewModel.swift
#	Session/Conversations/Settings/ThreadSettingsViewModel.swift
#	Session/Conversations/Views & Modals/ConversationTitleView.swift
#	Session/Notifications/AppNotifications.swift
#	Session/Settings/NukeDataModal.swift
#	Session/Shared/SessionTableViewModel.swift
#	Session/Shared/Views/SessionCell.swift
#	SessionMessagingKit/Configuration.swift
#	SessionMessagingKit/Database/Models/Contact.swift
#	SessionMessagingKit/Database/Models/DisappearingMessageConfiguration.swift
#	SessionMessagingKit/Messages/Control Messages/ClosedGroupControlMessage.swift
#	SessionMessagingKit/Messages/Message.swift
#	SessionMessagingKit/Messages/Visible Messages/VisibleMessage.swift
#	SessionMessagingKit/Protos/Generated/SNProto.swift
#	SessionMessagingKit/Protos/Generated/SessionProtos.pb.swift
#	SessionMessagingKit/Protos/SessionProtos.proto
#	SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ExpirationTimers.swift
#	SessionMessagingKit/Sending & Receiving/MessageReceiver.swift
#	SessionMessagingKit/Shared Models/SessionThreadViewModel.swift
#	SessionMessagingKitTests/Open Groups/OpenGroupManagerSpec.swift
#	SessionMessagingKitTests/_TestUtilities/TestOnionRequestAPI.swift
#	SessionSnodeKit/Models/SnodeAPIEndpoint.swift
#	SessionSnodeKit/SnodeAPI.swift
#	SessionTests/Conversations/Settings/ThreadDisappearingMessagesViewModelSpec.swift
#	SessionUtilitiesKit/General/Features.swift
2023-05-10 14:15:05 +10:00
Morgan Pretty a7af1ca768 Started laying the ground work for unit testing the JobRunnner
Starting injecting dependencies for the JobRunner
Turned the JobRunner into a singleton instance
2023-04-03 17:35:46 +10:00
Ryan Zhao d5343ac236 fix get_expiries endpoints & clean up 2023-01-23 12:17:09 +11:00
ryanzhao 33c239eae2 WIP: debug new endpoints 2023-01-20 17:04:21 +11:00
Ryan Zhao ef662b2152 fix a threading issue 2023-01-19 17:06:43 +11:00
Ryan Zhao 1fc8261944 fix update expiries testing on testnet 2023-01-19 16:30:31 +11:00
Ryan Zhao 73e05ec19e use new endpoint to shorten messages' TTL 2023-01-16 14:48:32 +11:00
ryanzhao 4c366dedc2 clean up SyncedExpiries 2023-01-11 14:11:40 +11:00
ryanzhao 9954cddc2a Merge branch 'dev' into disappearing-message-redesign 2023-01-10 13:54:28 +11:00
Ryan Zhao 9c39945c89 clean 2023-01-09 13:32:40 +11:00
Morgan Pretty a3da087352 Fixed a few build errors and cases where the offset wasn't taken into account 2022-12-21 17:46:18 +11:00
Morgan Pretty f7199b4c44 Updated the code to take the service node offset into account when setting timestamps 2022-12-21 16:39:52 +11:00
Ryan Zhao 3368f184de fix sync expiries job 2022-12-12 16:20:32 +11:00
Ryan Zhao f736e4709b refactor: make sync expiries to a job & only save sync message server hash for outgoing messages 2022-12-12 13:53:27 +11:00
Ryan Zhao 4225ba6a04 feat: do not update messages' ttl until the new design is enabled 2022-12-01 14:05:30 +11:00
ryanzhao 723d676d81 sync expiries message handling 2022-11-15 16:36:09 +11:00
ryanzhao 89a5739883 send sync expiries 2022-11-15 14:48:26 +11:00
Ryan Zhao e54a37ead0 update ttl after read when disappear after read is set 2022-11-03 17:07:30 +11:00
Morgan Pretty 7dc75af361 Fixed some bugs with disappearing messages
Fixed an issue where the DisappearingMessages job could incorrectly overwrite it's nextRunTimestamp
Fixed an issue where sent/self-send messages wouldn't correctly trigger the disappearing messages job
Fixed an issue where sending the mnemonic along with an attachment wasn't showing the warning prompt
Fixed an issue where the home screen wasn't updating on launch if the displayed messages were removed disappearing messages
Fixed a small UI glitch where the input field wouldn't immediately get cleared when sending a message (unfortunately there is a slight delay before the message appears still)
2022-09-19 14:02:11 +10:00
Morgan Pretty 8f3e7fc36a Removed the debug code and added a migration to remove the old YDB
Fixed a typo
2022-08-01 16:53:05 +10:00
Morgan Pretty 4d5ded7557 Fixed a few bugs with media attachment handling, added webp support
Updated the OpenGroupManager to create a BlindedIdLookup for messages within the `inbox` (validating that the sessionId does actually match the blindedId)
Added support for static and animated WebP images
Added basic support for HEIC and HEIF images
Fixed an issue where the file size limit was set to 10,000,000 bytes instead of 10,485,760 bytes (which is actually 10Mb)
Fixed an issue where attachments uploaded by the current user on other devices would always show a loading indicator
Fixed an issue where media attachments that don't contain width/height information in their protos weren't updating the values once the download was completed
Fixed an issue where the media view could download an invalid file and endlessly appear to be downloading
2022-07-29 15:26:24 +10:00
Morgan Pretty 8cf2a57fcc Renamed GRDBStorage to Storage (no use having the prefix anymore since the old DB is deprecated) 2022-07-01 13:08:45 +10:00
Morgan Pretty 20dc74bc96 Added paging to the Home/MessageRequests screens and fix a bunch of bugs
Added a cache to the Identicon to prevent unneeded image generation
Replaced some 'withTint' calls to use the standard 'withRenderingMode' instead
Fixed a bug where the background would remain when swiping to reply
Fixed a crash which could occur with String-based settings
Fixed an issue where all messages in a thread wouldn't get marked as read when opening the thread (ie. existing behaviour)
Fixed a bug where going to the all media screen from a specific
Fixed a bug where the 'areCallsEnabled' preference wasn't getting migrated
Fixed a bug where you couldn't join any of the default open groups
Fixed a bug where it was polling for the invalid placeholder default open group
Fixed a few threading issues related to PromiseKit defaulting to run on the main thread
Updated and number of processes to run on "default" priority queues intead of "userInitiated" ones (since the docs suggest those are blocking)
Optimised the PagedDatabaseObserver to do a much more efficient count query
Updated the PagedDatabaseObserver to allow for triggering content updates when data changes outside of the paged or associated tables changes
Updated the HomeVC and MessageRequestsViewController to use paged queries
Made some optimisations to prevent unneeded database changes
2022-06-24 18:29:45 +10:00
Morgan Pretty 26c7a5022a Added a simple migration progress indicator and animation (need timing tweaks)
Cleaned up the creation of the GRDBStorage instance
Fixed an issue where the launch screen wasn't setting it's background colour based on the system setting
Renamed the GRDBStorageError to StorageError (in preparation of legacy 'Storage' relocation)
Consolidated the two Environment classes (in Swift)
Refactored the AppSetup class to Swift
2022-05-30 13:04:26 +10:00
Morgan Pretty b541666ef0 Got the ability to send message working again and other tweaks
Tested and fixed a couple of issues with the disappearingMessages job
Added a simple dependency system for jobs (primarily for the AttachmentUploadJob, but will likely be others later)
Setup the AttachmentUploadJob again (looks like there are cases which use it)
Prevented a possible infinite job deferral loop from causing the app to crash (the loop is still technically possible but the app will continue to run now)
Updated the interactions unique constraints based on testing and discussions around how the serverHash works
Deleted the legacy ReadReceipt handling (now managed via the 'interaction.wasRead' flag and 'SendReadReceiptsJob')
Deleted the unused SSKIncrementingIdFinder
2022-05-06 12:44:26 +10:00
Morgan Pretty 32304ae5dd Cleared out some of the legacy serialisation logic, further UI binding
Refactored the SignalApp class to Swift
Fixed a horizontal alignment issue in the ConversationTitleView
Fixed an issue where expiration timer update messages weren't migrated or rendering correctly
Fixed an issue where expiring messages weren't migrated correctly
Fixed an issue where closed groups which had been left were causing migration failures (due to data incorrectly being assumed to be required)
Shifted the Legacy Attachment types into the 'SMKLegacy' namespace
Moved all of the NSCoding logic for the TSMessage
2022-05-03 17:14:56 +10:00
Morgan Pretty 3baeb981d9 Further work on the JobRunner
Moved the JobRunner into SessionUtilitiesKit so it can be used by SessionSnodeKit
Exposed a 'sharedLokiProject' value on UserDefaults to remove the hard-coded group name used everywhere
Added "blocking" job support for 'OnLaunch' and 'OnActive' jobs to the JobRunner (will retry until it succeeds)
Added the UpdateProfilePicture and RetrieveDefaultOpenGroupRooms jobs
2022-04-27 10:48:54 +10:00
Morgan Pretty ed9f4ea6c6 Fixed a few closed group and job issues
Fixed a few job migration issues
Fixed an issue with the closed group key pair management (wasn't storing keys correctly)
Refactored the OWSSound (now Preferences.Sound)
Added the logic for the AttachmentDownloadJob and enabled jobs to be cascade deleted via interactions
Optimised the HomeViewModel database observation query (fetch specific columns so changes outside those don't trigger updates)
Updated to the latest GRDB (ran into a deadlock which should be fixed in a newer version)
2022-04-22 18:47:11 +10:00
Morgan Pretty 11231599db Further work on migrations and message pipeline refactoring
Refactored the AppDelegate from Objective C to Swift
Updated the HomeVC to use GRDB
Refactored a number of the Job types to be driven via GRDB and the new JobRunner
Fixed a bug where the LinkPreviewView wouldn't render correctly in dark mode
2022-04-21 16:42:35 +10:00