Commit Graph

16406 Commits

Author SHA1 Message Date
Morgan Pretty e6691b515f
Merge pull request #650 from oxen-io/dev
2.0.0
2022-08-09 15:25:36 +10:00
Morgan Pretty b40752dc78
Merge pull request #649 from mpretty-cyro/fix/background-fetch-timeout
Fix/background fetch timeout
2022-08-09 15:24:53 +10:00
Morgan Pretty 201c59fd2b Updated the logic for the background fetch timeout
Updated the logic for the background fetch timeout to happen in the AppDelegate and be based on a system property to avoid a few edge-cases
Removed the ID Blinding error handling 'e' suffix (as it's not actually part of the error)
2022-08-09 15:18:57 +10:00
Morgan Pretty f2cda62882 Merge remote-tracking branch 'upstream/dev' into dev 2022-08-08 15:15:38 +10:00
Morgan Pretty 0596e81fd9
Merge pull request #648 from oxen-io/dev
2.0.0
2022-08-08 15:14:32 +10:00
Morgan Pretty 7ec48baffa
Merge pull request #612 from mpretty-cyro/feature/database-refactor
Database refactor
2022-08-08 15:11:29 +10:00
Morgan Pretty 09f2b41242 Updated the build number 2022-08-08 15:10:33 +10:00
Morgan Pretty 2025fd2638 Fixed a crash and the SOGS deletion logic to continue to support the deprecated approach for the time being
Fixed an issue where the app could crash when entering the background during migration
Added the old 'messageServerIdsToRemove' code back for the time being to support the deprecated deletion behaviour
2022-08-08 13:56:11 +10:00
Morgan Pretty 3f63a44c31 Increased the build number 2022-08-05 17:11:14 +10:00
Morgan Pretty 1224e539ea Reduced unneeded DB write operations and fixed a few minor UI bugs
Updated the database to better support the application getting suspended (0xdead10cc crash)
Updated the SOGS message handling to delete messages based on a new 'deleted' flag instead of 'data' being null
Updated the code to prevent the typing indicator from needing a DB write block as frequently
Updated the code to stop any pending jobs when entering the background (in an attempt to prevent the database suspension from causing issues)
Removed the duplicate 'Capabilities.Capability' type (updated 'Capability.Variant' to work in the same way)
Fixed a bug where a number of icons (inc. the "download document" icon) were the wrong colour in dark mode
Fixed a bug where the '@You' highlight could incorrectly have it's width reduced in some cases (had protection to prevent it being larger than the line, but that is a valid case)
Fixed a bug where the JobRunner was starting the background (which could lead to trying to access the database once it had been suspended)
Updated to the latest version of GRDB
Added some logic to the BackgroundPoller process to try and stop processing if the timeout is triggered (will catch some cases but others will end up logging a bunch of "Database is suspended" errors)
Added in some protection to prevent future deferral loops in the JobRunner
2022-08-05 17:10:01 +10:00
Morgan Pretty ecbded3819 Cleaned up the poller logic a bit 2022-08-04 18:09:03 +10:00
Morgan Pretty f8b2f73f7b Fixed a few issues found during QA
Fixed an issue where quotes containing images wouldn't send
Fixed an issue where a MessageSend job could get stuck in an infinite retry loop if it had an attachment in an invalid state
Fixed an issue where quotes containing non-media files wouldn't contain the correct data
Fixed an issue where the quote thumbnail was getting the wrong content mode set
Fixed an issue where the local disappearing messages config wasn't getting generated correctly
Fixed an issue where the format parameters for the disappearing message info message were the wrong way around in one case
Updated the AttachmentUploadJob to try to support images which haven't completed downloading (untested as it's not supported via the UI)
2022-08-04 13:25:46 +10:00
Morgan Pretty d8103ede12 Updated the build number 2022-08-03 09:12:01 +10:00
Morgan Pretty 5f1039b39e Updated the PushNotificationAPI to use V4 onion requests instead of V2
Fixed a crash which could occur when handling 'loadMedia' edge cases in the MediaView (was running on non-main thread)
2022-08-03 09:10:20 +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 b468efc33b Updated the GarbageCollectionJob to log the number of files it removes 2022-08-01 10:05:30 +10:00
Morgan Pretty fde19efc13 Fixed a duplicate dependency issue 2022-07-29 15:29:20 +10:00
Morgan Pretty 775cc4f156 Increased build number 2022-07-29 15:27:53 +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 c022f7cda2 Added an exponential back-off to polling open groups when they fail to poll 2022-07-28 18:26:22 +10:00
Morgan Pretty ae4999c3a7 Fixed a couple of crashes and a couple of other bugs
Fixed a crash due to database re-entrancy
Fixed an issue where interacting with a push notification wouldn't open the conversation in some cases
Added code to prevent a user from being able to start a DM with a blinded id
Updated some open group polling logs to be clearer
2022-07-28 15:36:56 +10:00
Morgan Pretty aed1b73185 Fixed a few additional issues uncovered
Added a explicit "timeout" error to make debugging a little easier
Added code to prevent the AttachmentUploadJob from continuing to try to upload if it's associated interaction has been deleted
Updated the getDefaultRoomsIfNeeded to make an unauthenticated sequence all to get both capabilities and rooms (so we will know if the server is blinded and retrieve the room images using blinded auth)
Fixed a bug where the notification badge wouldn't get cleared when removing data from a device
Fixed a bug where adding an open group could start with an invalid 'infoUpdates' value resulting in invalid data getting retrieved
Fixed a bug where under certain circumstances the PagedDatabaseObserver was filtering out updates (noticeable when restoring a device, would happen if the currentCount of content was smaller than the pageSize)
2022-07-26 11:36:32 +10:00
Morgan Pretty 9859cf95a4 Attempted to fix the notification & call reporting issues
Fixed an issue where fileIds weren't correctly getting sent along with open group messages
Fixed an issue where the screens could miss updates if the device was locked with the app in the foreground and then later unlocked after receiving notifications
Added an optimisation to prevent attempting to send a message after it has been deleted
Added logic to report fake calls if the code goes down an invalid code path when handling a call (to prevent Apple blocking the app)
Delayed the core which clears notifications to increase the time the app has to handle interactions (just in case it was a race condition)
2022-07-25 17:03:09 +10:00
Morgan Pretty 3df3114bee Fixed the broken unit tests 2022-07-19 09:22:15 +10:00
Morgan Pretty 44e7a2dfa4 Added defensive coding to prevent some crashes
Added some defensive coding to prevent path selection from being able to crash due to being empty
Fixed a crash where the MediaDetailViewController could access UI on a non-main thread
Updated the BackgroundPoller to no longer retry the users or closed group swarms and to "cancel" and return immediately if we hit 25 seconds of run time (OS will kill the process if we hit 30 seconds)
2022-07-18 17:40:32 +10:00
Morgan Pretty 0d80678a77 Updated the message request approval process to run asynchronously
Fixed a bug where the MessageRequestsViewController wouldn't page properly in certain cases
2022-07-18 12:32:46 +10:00
Morgan Pretty d730ce3e62 Reverted the logic to only download attachments when opening a conversation (new flag in future)
Fixed a minor bug where the UpdateProfilePictureJob could get stuck in a "defer loop"
2022-07-18 10:08:26 +10:00
Morgan Pretty 9fff4dce20 Fixed a number of bugs found during QA
Fixed a bug where the "Block user" toggle wasn't correctly reflecting the current users state
Fixed a bug where the "Blocked banner" wasn't showing the "unblock this user" alert.
Fixed a bug where the "Blocked banner" wouldn't re-appear if you re-block a user after unblocking them.
Fixed a bug where the conversation screen unblocking logic wasn't actually unblocking the user.
Fixed a bug where some settings options were disabled in open groups because the code thought the user had left the group.
Fixed a bug where the settings button wouldn't appear after accepting a message request.
2022-07-18 09:54:23 +10:00
Morgan Pretty 3c07a2d044 Added linting for the localized strings, updated the quote & mention behaviour for the current user
Added a script and build step to error if we have localised a string in code bug don't have an entry in the localisable files
Added the logic and UI to replace the current users public key (or blinded key) with 'You' in mentions and quotes
Cleaned up some duplicate & missing localised strings
Fixed a bug where new closed groups weren't getting setup locally correctly
Updated the id truncating behaviour to always truncate from the middle
2022-07-15 18:15:28 +10:00
Morgan Pretty 5b6be3912d Fixed an edge-case crash, a couple of minor bugs and made future-proofing tweaks
Fixed a bit of the OnionRequest error handling to better send through server error messages for debugging
Fixed a bug where the initial offset could be negative if the number of messages was less than the page size resulting in a crash
Fixed a crash due to a code path which was thought to be impossible exiting but is actually possible (so just erroring)
Added the 'expire' SnodeAPI endpoint
Removed the 'openGroupServerTimestamp' property (was unused and just added confusion)
Updated the logic to always handle the 'fileId' for uploads/downloads as a string instead of casting it to an Int64
Updated the OpenGroup room parsing to support either Int or String values for image ids
2022-07-12 17:43:52 +10:00
Morgan Pretty b4ab521713 Fixed a bug with the message request UI and with recurring job retrying
Fixed a bug where jobs that recur on launch or active could end up endlessly retrying if they failed once
Fixed a bug where the message request UI would appear for outgoing message requests
2022-07-11 14:26:23 +10:00
Morgan Pretty fd76438686 Fixed an issue where the 'message trimming' setting wouldn't get set to on by default if there was no legacy database 2022-07-11 09:57:06 +10:00
Morgan Pretty 9b10944567 Increased build number 2022-07-08 17:54:07 +10:00
Morgan Pretty 4afddd6fbb Fixed a number of reported bugs, some cleanup, added animated profile support
Added support for animated profile images (no ability to crop/resize)
Updated the message trimming to only remove messages if the open group has 2000 messages or more
Updated the message trimming setting to default to be on
Updated the ContextMenu to fade out the snapshot as well (looked buggy if the device had even minor lag)
Updated the ProfileManager to delete and re-download invalid avatar images (and updated the conversation screen to reload when avatars complete downloading)
Updated the message request notification logic so it will show notifications when receiving a new message request as long as the user has read all the old ones (previously the user had to accept/reject all the old ones)
Fixed a bug where the "trim open group messages" toggle was accessing UI off the main thread
Fixed a bug where the "Chats" settings screen had a close button instead of a back button
Fixed a bug where the 'viewsToMove' for the reply UI was inconsistent in some places
Fixed an issue where the ProfileManager was doing all of it's validation (and writing to disk) within the database write closure which would block database writes unnecessarily
Fixed a bug where a message request wouldn't be identified as such just because it wasn't visible in the conversations list
Fixed a bug where opening a message request notification would result in the message request being in the wrong state (also wouldn't insert the 'MessageRequestsViewController' into the hierarchy)
Fixed a bug where the avatar image wouldn't appear beside incoming closed group message in some situations cases
Removed an error log that was essentially just spam
Remove the logic to delete old profile images when calling save on a Profile (wouldn't get called if the row was modified directly and duplicates GarbageCollection logic)
Remove the logic to send a notification when calling save on a Profile (wouldn't get called if the row was modified directly)
Tweaked the message trimming description to be more accurate
Cleaned up some duplicate logic used to determine if a notification should be shown
Cleaned up some onion request logic (was passing the version info in some cases when not needed)
Moved the push notification notify API call into the PushNotificationAPI class for consistency
2022-07-08 17:53:48 +10:00
Morgan Pretty 6b9a19c761 Fixed a few more bugs and made a couple of optimisations to the GarbageCollectionJob
Added an index on Quote.authorId and added a garbage collection job to remove orphaned Profile entries
Added a few more indexes to improve the GarbageCollectionJob performance
Added some debug code to force a re-migration on next launch if the DB is invalid (only affects testers so code should be removed)
Fixed an issue where the GetSnodePool job wasn't properly blocking
Fixed an issue where a user could send the same message multiple times if they clicked the send button quickly enough
Fixed an issue where profiles might not have been getting created correctly for ClosedGroup members which have no threads/interactions
2022-07-05 16:47:12 +10:00
Morgan Pretty 34fea96db3 Fixed a bunch more bugs around push notifications and avatars
Added code to prevent the garbage collection job from auto-running more often than once every 23 hours
Fixed a bug where if the first avatar you try to add is your own, it could fail due to the folder not getting created
Fixed a bug where updating your profile would store and send an invalid profile picture url against your profile
Fixed an issue where the closed group icon wouldn't appear as the double icon when it couldn't retrieve a second profile
Fixed a bug where the device might not correctly register for push notifications in some cases
Fixed a bug where interacting with a notification when the app is in the background (but not closed) wasn't doing anything
Fixed a bug where the SyncPushTokensJob wouldn't re-run correctly in some cases if the user was already registered
Updated the profile avatar downloading logic to only download avatars if they have been updated
Updated the migration and OpenGroupManager to force Session-run open groups to always use the OpenGroupAPI.defaultServer value
2022-07-04 17:36:48 +10:00
Morgan Pretty fe2e2510bb Fixed a bug where open group messages sent on another device weren't correctly getting marked as sent 2022-07-01 17:46:50 +10:00
Morgan Pretty f9f0662558 Removed an import for file deleted as part of the iOS 13 min version changes
Fixed a bug where opening a conversation by tapping a notification wouldn't mark the conversation messages as read
2022-07-01 13:59:50 +10:00
Morgan Pretty f9b0c0feed Merge branch 'dev' into feature/database-refactor
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Utilities/BackgroundPoller.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/ClosedGroupPoller.swift
2022-07-01 13:41:46 +10:00
Morgan Pretty 5302982804 Merge remote-tracking branch 'upstream/dev' into dev 2022-07-01 13:37:08 +10:00
Morgan Pretty cdb211b72a Applied the "increase min version to iOS 13" changes 2022-07-01 13:33:00 +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 eb0118ac10 Fixed a few more bugs and tweaked attachment download logic
Updated the code to only auto-start attachment downloads when a user opens a conversation (and only for the current page of messages)
Updated the GarbageCollectionJob to default to handling all cases (instead of requiring the cases to be defined) - this means we can add future cases without having to recreate the default job
Added logic to remove approved blinded contact records as part of the GarbageCollectionJob
Added code to better handle "invalid" attachments when migrating
Added a mechanism to retrieve the details for currently running jobs (ie. allows us to check for duplicate concurrent jobs)
Resolved the remaining TODOs in the GRDB migration code
Cleaned up DB update logic to update only the targeted columns
Fixed a bug due to a typo in a localised string
Fixed a bug where link previews without images or with custom copy weren't being processed as link previews
Fixed a bug where Open Groups could display with an empty name value
2022-07-01 12:52:41 +10:00
Morgan Pretty f2bd72b3ae Fixed a couple more bugs
Fixed an issue with updating the users profile image
Fixed an annoying bug where the conversation screen would "bounce" when initial loading
2022-06-30 17:48:43 +10:00
Morgan Pretty aa25b9c8bc Updated the code to remove blinded contact records once they become unblinded (no point keeping them) 2022-06-29 18:12:20 +10:00
Morgan Pretty c7e8071dd1 Fixed a large number of bugs and added a setting to control open group message deletion
Added a setting to control whether open group messages older than 6 months should be pruned
Added some defensive coding to prevent an edge-case which could cause a crash (wasn't filtering out a potential invalid row from the home screen data)
Fixed a bug where preOffer call messages weren't correctly sending push notifications
Fixed a bug where all incoming calls would be rejected and seen as calls disabled
Fixed a bug where the copy on call info messages was displaying the sender's name instead of the thread contact's name for outgoing calls
Fixed a bug where the input view wouldn't appear when creating new DM conversations
Fixed a bug where threads might not show the message request approval UI
Fixed an issue where some logic might not have run correctly when first registering an account
Fixed a bug where the note to self thread could incorrectly appear when restoring a device
Updated the GarbageCollectionJob to run onActive instead of onLaunch (since it's likely we will rarely launch)
Updated the logic for erasing an account from a device
2022-06-29 18:10:10 +10:00
Morgan Pretty 76f7e4e246 Fixed a number of bugs, added in logic to handle id blinding being enabled and migrated session SOGS IPs to domains
Added logic to handle the case when ID blinded gets switched on server-side and the app already has open groups with cached capabilities
Added logic to migrate users from using HTTP and IP-based session open groups to use the HTTPS domain name url instead
Fixed a bug with the PushNotificationAPI update registration response structure
Fixed some broken unit tests (and a bug which was introduced in an earlier optimisation)
Fixed a bug where trusting a contact (to download their messages) wouldn't trigger the message UI to update
Fixed a bug where tapping a push notification wasn't opening the associated thread when the app isn't running in the background
2022-06-28 17:53:03 +10:00
Morgan Pretty ff2d96e0d5 Fixed a handful more bugs
Fixed an issue where I'd shifted push notification logic to a background thread resulting in crashes
Fixed a bug where the status indicator view on the FullConversationCell was incorrectly showing for incoming messages
Fixed a bug where outgoing messages to closed groups would all be flagged as failed to send
Fixed a bug with the "autoLoadNextPageIfNeeded" on the conversation screen
Fixed a bug where the input view on a closed group wouldn't appear correctly based on whether the user was a member or not
Added the "autoLoadNextPageIfNeeded" logic to the home screen
2022-06-27 17:57:46 +10:00
Morgan Pretty 2cd9f571da Fixed a number of bugs
Fixed a bug where threads might not be getting marked as read correctly
Fixed a bug where the GarbageCollectionJob could end up blocking the database write thread (seemed to only hang when the debugger was attached but may have affected devices at some point)
Fixed a bug with thread sorting
Fixed a bug where joining an open group wouldn't appear until after the first poll completed
Fixed a bug where conversations with no interactions would display odd interaction copy
Fixed a bug where the sender name was appearing above outgoing messages in groups
2022-06-27 12:04:51 +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