Commit Graph

215 Commits

Author SHA1 Message Date
ryanzhao 782d51c1d6 minor change on hardfork version check 2022-05-04 16:43:22 +10:00
ryanzhao 372e87e70f minor fix 2022-05-04 16:36:15 +10:00
ryanzhao 7cc887267f fix retrieve from default inbox 2022-05-04 16:12:45 +10:00
ryanzhao e540497724 update last hash persistence 2022-05-04 11:47:09 +10:00
ryanzhao 4224a1fa3c tweaks for sending message to snode 2022-05-04 10:34:35 +10:00
ryanzhao 15b954dbd6 persist hardfork info 2022-05-04 10:14:15 +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
ryanzhao 38523230cb update namespace 2022-05-03 09:18:53 +10:00
Ryan Zhao 9c535dcb1b update namespace number 2022-05-02 16:54:36 +10:00
Ryan Zhao 034f2ecc22 send messages with authentication 2022-05-02 13:51:50 +10:00
Ryan Zhao 0b0f0a3787 retrieve messages authenticated for 1-1 chats 2022-05-02 11:35:48 +10:00
Ryan Zhao f9bb1517a1 fix an issue where closed groups stop to be updated part 1 2022-04-28 15:38:30 +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 94742c80ec Further work on the JobRunner
Fixed an issue where the hash retrieved when fetching messages from the service node might not be the latest one
Updated the MessageReceiveJob to batch process messages (on failure only the failed messages will retry)
2022-04-26 17:31:50 +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
Morgan Pretty 4380f1975c Further work on the DB refactoring
Added the rest of the interaction structure to the database (testing some migration logic now - still needs to be finalised)
Updated the YDBToGRDB migrations to wrap their inserts in autorelease pools (helps memory slightly, unfortunately it's caching the YDB data which uses the most memory but we have opted for speed over RAM at the moment)
Updated the MockDataGenerator so it should now "chunk" the code generation (crazy large figures were previously resulting in excessive memory usage)
2022-04-08 16:56:33 +10:00
Morgan Pretty cf66edb723 Further work on SessionMessagingKit migrations
Added migrations for contacts and started working through thread migration (have contact and closed group threads migrating)
Deprecated usage of ECKeyPair in the migrations (want to be able to remove Curve25519Kit in the future)
2022-04-06 15:43:26 +10:00
Morgan Pretty 4ee4b3ffb3 Started adding migration logic for contacts
Updated the getUserHexEncodedPublicKey to take an optional db value so we can retrieve it during the initial migration
2022-04-04 13:18:14 +10:00
Morgan Pretty 410f37f0d5 Updated the SnodeSet table name to match the type
Shifted all GRDB Snode convenience methods to be extensions on Snode (instead of SnodeSet) for consistency
2022-04-04 09:52:48 +10:00
Morgan Pretty 63db2a4e3d Updated the 'SwarmSnode' to use the 'port_https' key instead of the 'port' key (deprecated) 2022-04-04 09:33:12 +10:00
Morgan Pretty a1b4554cdb Migrated the SessionSnodeKit from YapDatabase to GRDB
Changed the min OS version to iOS 13.0 (support for 'Identifiable')
Removed the alternate approaches to fetching the userKeyPair and userPublicKeyHexString (no consistently routed through the caching method)
Migrated the 'OWSIdentityManager' logic to use the new 'Identity' type
Added the 'Setting' table and got the pattern working fairly nicely (unfortunately there isn't a good way to avoid key collision without proper enums)
Updated the SessionSnodeKit to migration it's data from YDB to GRDB
Updated the SessionSnodeKit to use GRDB throughout it's logic
2022-04-01 17:22:45 +11:00
Morgan Pretty e65682ae9b Merge branch 'dev' into feature/database-refactor
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Backups/OWSBackup.m
#	Session/Backups/OWSBackupImportJob.m
#	SessionSnodeKit/SnodeAPI.swift
2022-03-31 12:09:04 +11:00
Morgan Pretty 529e416dd1 Started work on GRDB logic and migrations
Setup a migration pattern
Setup the database configuration and security
Started defining the database schema
Started working on the migrations for SessionSnodeKit
2022-03-31 11:47:09 +11:00
Morgan Pretty 5ca227434b Merge branch 'dev' into feature/session-id-blinding-part-2
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Utilities/BackgroundPoller.swift
#	SessionMessagingKit/Database/Storage+OpenGroups.swift
#	SessionMessagingKit/Messages/Control Messages/ConfigurationMessage+Convenience.swift
#	SessionMessagingKit/Open Groups/OpenGroupAPIV2.swift
#	SessionMessagingKit/Open Groups/OpenGroupManagerV2.swift
#	SessionMessagingKit/Sending & Receiving/MessageSender.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPollerV2.swift
#	SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift
#	SessionMessagingKit/Storage.swift
#	SessionMessagingKit/Utilities/General.swift
#	SessionSnodeKit/SnodeAPI.swift
#	SessionUtilitiesKit/General/Atomic.swift
2022-03-29 09:15:32 +11:00
Morgan Pretty b90904ebbd Updated the code to only update the last message hash once the MessageReceiveJobs have been created 2022-03-22 14:09:47 +11:00
Ryan Zhao 6bc0177bd4 fix path building crash 2022-03-17 10:13:00 +11:00
Morgan Pretty cb27da48b7 Updated the code to handle a clock out of sync error (different error code from v2 & v3) 2022-03-15 16:51:10 +11:00
Morgan Pretty 17a9e510c5 Further work on unit tests (and a couple of bug fixes found when testing)
Removed a couple remaining TODOs
Added 'standardUserDefaults' to the 'Dependencies' type
Tweaked the OpenGroupAPI to only update the 'lastOpen' timestamp if it successfully polls
Refactored a couple of methods in the ConversationViewItem into swift so we can clean up the OpenGroupAPI more
Updated the OpenGroupAPI so it no longer has static variables for state (shifted to the OpenGroupManager and made them instance variables)
Fixed an encoding issue with the Capabilities.Capability
2022-03-07 17:43:30 +11:00
Morgan Pretty 81f563229f Renamed FileServerAPIV2 to FileServerAPI
Updated the direct file upload/download to use the non-base64 approaches as well
Updated the attachment 'serverId' value to be a string instead of a UInt64 (future-proofing)
Updated the OnionRequest V4 response handling to avoid converting the "response body" part to a string and processing that, instead just slice the byte array (ie. stopped it from being broken from multiple conversions)
Removed the base64-based file upload/download endpoints (no use including them when they are inefficient and we don't want to use them)
2022-03-04 16:17:03 +11:00
Morgan Pretty 1c474955de File upload working, further code cleanup
Got the updated file upload working
Removed the legacy 'room' header
Consolidated a number of types between SOGS, FileServer and general requests
Updated the OnionRequestAPI to deal with a Data payload (rather than encoding it to a string and then back to data)
2022-03-04 13:33:06 +11:00
Morgan Pretty 6936f35f2a Fixed a few issues uncovered while testing and some cleanup
Fixed an incorrect optional in RoomPollInfo
Fixed an incorrect parameter name in the ClosedGroupRequestBody
Fixed a crash due to a change in the ContactUtilities
Cleaned up the duplicate code in the OnionRequestAPI, HTTP and SnodeAPI to all use 'Data' response types
Updated the SnodeAPI to casting types to Any (made it hard to catch breaking changes with HTTP and OnionRequestAPI)
2022-03-02 13:09:45 +11:00
Morgan Pretty cc2a077a6c Started working on `MessageRequestResponse` handling for SOGS message requests
Pointing Curve25519 to use a fork that exposes an XEd25519 conversion method
Fixed an issue where I had broken all message sending due to the SnodeAPI casting Onion responses to `Any`
2022-02-25 17:48:09 +11:00
Morgan Pretty ef09d4d5aa Additional encryption work on id blinding
Got the updated blinding logic working (at least when authenticating a request - still need to deal with message signing and verification)
Storing the server capabilities in the database now so we can correctly blind requests based on them
Renamed the remaining 'v2' functions and classes to just be 'OpenGroup' since there isn't a 'V2' anymore
Cleaned up a few TODOs and functions
2022-02-17 18:33:23 +11:00
Morgan Pretty eb927c36a9 Started cleaning up some of the SOGS and Onion Requests structure
Cleaned up the OnionRequestAPI so we don't need the LegacyOnionRequestAPI
Added requests for the user endpoints
Added deprecated flags to the legacy endpoints and functions
Added some logic to start handling the new poll (batch) response
Started adding unit tests for the OpenGroupAPI functions
2022-02-15 13:55:59 +11:00
Morgan Pretty c90f346d6a Further SOGS V4 integration work
Added in the v4 onion requests logic
Added in the new pin/unpin APIs
Split up additional legacy methods to try and simplify the refactoring
Added a number of TODOs around usage of legacy request methods
2022-02-14 14:07:45 +11:00
Morgan Pretty 4f3900771e More work on getting SOGS V4 integrated
Updated the MessageSendJob to support V4 messages (V2 messages will be upgraded to V4 if they get re-encoded)
Renamed the Message+Destination from 'openGroup' & 'openGroupV2' to 'legacyOpenGroup' and 'openGroup'
Started plugging in more of the V4 APIs
Renamed a number of the V2 APIs to start with 'legacy'
2022-02-11 16:48:16 +11:00
Morgan Pretty 2284375fc0 Started work on updated SOGS support
Split the OpenGroupAPIV2 into separate files
Started working on the new auth and blinded-id approaches (new auth working with un-blinded id suggesting blinded-id code is incorrect)
Updated the SOGS request/response types to use Codable
Updated the SOGS Request type to use enums instead of strings for keys (to reduce likelihood of typos breaking things)
Updated SessionMessagingKit to use Codable and JSONEncoder/JSONDecoder instead of the legacy JSONSerialization
Cleaned up some naming conventions in the SessionMessagingKit (calling a URLRequest body 'parameters' is very confusing...)
Removed the custom TSRequest class (just using standard URLRequest everywhere instead)
Added a number of extension functions to enable some more functional-coding styles
Added extensions to Sodium methods to allow scalar multiplication and the ability to hash providing a salt and a personalisation value (both needed for new SOGS auth)
Fixed an issue where the legacy auth for SOGS could crash due to threading issues (multiple threads accessing the same variable)
Fixed an issue where if you were in two rooms in a single SOGS and deleted one of them, the other room would stop getting updates as the server public key was getting removed
2022-02-10 11:17:41 +11:00
Morgan Pretty 394b0646a3 Updated the code to support additional session id prefixes 2022-02-08 16:37:01 +11:00
Morgan Pretty 03fb5cbeeb Cleanup and tweaks
Fixed some compilation issues.
Removed an unused dependency.
Cleaned up the Podfile to minimise duplication.
Pointed at an oxen fork of SignalCoreKit instead of a personal one.
2022-01-25 12:05:45 +11:00
Ryan Zhao 5f6da0739e delete message on storage server 2021-08-03 10:26:18 +10:00
Ryan Zhao e8f0d0d124 WIP: delete from storage server 2021-08-02 17:07:29 +10:00
Ryan Zhao c68350f3d8 store hash value for outgoing messages 2021-08-02 14:49:34 +10:00
Niels Andriesse 1a237557ff Add documentation 2021-07-29 10:19:24 +10:00
Niels Andriesse 140f07df96 Disable authenticated retrieval for now 2021-07-27 10:38:58 +10:00
Niels Andriesse 2360af5993 Implement authenticated message retrieval 2021-07-26 09:50:40 +10:00
Niels Andriesse 81820c0013 Remove unnecessary check 2021-07-23 14:10:44 +10:00
Niels Andriesse 8a29469eb5 Handle incorrect clock setting 2021-07-23 13:42:13 +10:00
Niels Andriesse 41fe33525c Don't unnecessarily open sync transactions 2021-07-22 13:07:51 +10:00
Niels Andriesse 498f5a73b0 Don't unnecessarily open sync transactions 2021-07-22 12:59:31 +10:00
Niels Andriesse e84fc1aa04 Include destination info in error messages 2021-07-15 09:47:03 +10:00
Niels Andriesse bea80c67b3 Make error more descriptive 2021-07-13 09:50:09 +10:00
Niels Andriesse ef2eab7e9f Implement SnodeAPI.clearAllData() 2021-07-12 13:22:35 +10:00
Niels Andriesse a774d5f004 Re-use existing build paths promise if possible 2021-07-09 16:19:27 +10:00
nielsandriesse 1b68c109ee Fix build 2021-05-12 10:33:02 +10:00
nielsandriesse 5c699d6bb7 Fix inverted operation 2021-05-12 09:23:19 +10:00
nielsandriesse b694777a71 Fix snode pool updating bug 2021-05-12 09:13:53 +10:00
Niels Andriesse e93af07b61 Fix ONS 2021-05-03 10:29:08 +10:00
Niels Andriesse 371222098b Fix snode pool updating bug 2021-05-03 09:08:50 +10:00
Niels Andriesse be382a6031 Add fix for temporary path building issue 2021-05-03 08:35:15 +10:00
Niels Andriesse e9df213bfe Put feature flags in one place 2021-04-27 08:53:18 +10:00
Niels Andriesse 1561b9436f Fix missing query parameters 2021-04-22 16:12:13 +10:00
nielsandriesse 583f5e3483 Clean 2021-04-21 11:32:28 +10:00
nielsandriesse fec4bfb836 Debug 2021-04-21 11:30:59 +10:00
Niels Andriesse 66181baf2b Debug 2021-04-20 16:43:02 +10:00
Niels Andriesse d39387bf01 Debug 2021-04-20 16:10:27 +10:00
Niels Andriesse 2f67073a5a Implement new snode pool updating method 2021-04-20 15:21:28 +10:00
Niels Andriesse 8aa25af4d5 Rework things in advance of new snode pool updating method 2021-04-20 14:58:29 +10:00
Niels Andriesse 1002cc51ae Remove PoW too low error code handling 2021-04-20 14:28:07 +10:00
Niels Andriesse 727dccfbb7 Remove PoW too low error code handling 2021-04-20 14:23:32 +10:00
Niels Andriesse 2feae0dea4 Debug 2021-04-20 11:18:02 +10:00
Niels Andriesse 8375b598ad Don't hardcode scheme and port 2021-04-20 11:13:55 +10:00
Niels Andriesse fac376bf55 Use HTTP for default session open group server 2021-04-20 09:40:25 +10:00
nielsandriesse 8433c2d4ab Remove debug code 2021-04-14 15:49:08 +10:00
nielsandriesse a76c43973f Increase TTL & remove PoW 2021-04-14 15:46:40 +10:00
Niels Andriesse 89b96447e1
Merge pull request #378 from oxen-io/tls
Self-Signed Seed Node Certificates
2021-04-07 13:24:20 +10:00
nielsandriesse 75f5591fe0 Store certificates in DER format 2021-04-07 09:26:27 +10:00
Niels Andriesse 58748471a4 Set up skeleton code 2021-04-01 15:27:44 +11:00
Ryan ZHAO 4fd34005dc fix opening transactions in filter. 2021-04-01 13:23:21 +11:00
Niels Andriesse 34bbff1ab4 Implement OpenGroupAPIV2 2021-03-24 10:54:38 +11:00
nielsandriesse 66d46f3dd0 Debug 2021-03-03 14:10:54 +11:00
Niels Andriesse 4958d3d368 Implement ONS API 2021-03-03 11:16:34 +11:00
Niels Andriesse cf07fc1b1a Implement nicknames 2021-03-01 13:15:54 +11:00
Niels Andriesse 8477f75426 Fix unnecessary path rebuilding 2021-02-08 10:21:02 +11:00
Niels Andriesse 647bdb0d10 Fix error copy 2021-01-28 15:03:45 +11:00
Niels Andriesse ee1d4b1bd5 Debug & make UI clearer 2021-01-06 10:37:26 +11:00
Niels Andriesse 40d199a90b Clean up SnodeAPI 2020-12-18 15:17:23 +11:00
nielsandriesse 9ebb448b5f Fix crash 2020-12-14 09:00:50 +11:00
nielsandriesse 7ca3b73fd8 Fix crash 2020-12-14 08:57:59 +11:00
Niels Andriesse efe8f1c8bb Clean 2020-12-07 16:00:21 +11:00
Niels Andriesse 905b829de2 Refresh snode pool at least once a day 2020-12-07 09:29:46 +11:00
Niels Andriesse 557a851dce Enforce assumptions 2020-12-04 17:10:00 +11:00
nielsandriesse d6c115bc2a Fix module linking issue 2020-12-02 16:25:16 +11:00
Niels Andriesse f6b78f9e99 Adjust snode API parameters 2020-11-26 16:06:20 +11:00
nielsandriesse 5dfd4b1965 Restructure 2020-11-25 16:15:16 +11:00
nielsandriesse 6dc3184b2a Merge branch 'dev' into refactor-3 2020-11-13 10:07:45 +11:00
nielsandriesse 5d8d468826 Implement SessionSnodeKit & SessionProtocolKit conformances 2020-11-12 09:30:03 +11:00
nielsandriesse 000e907d47 Clean up Podfile 2020-11-12 07:55:24 +11:00
nielsandriesse 7e213c71d5 Make everything build again 2020-11-11 17:45:50 +11:00
nielsandriesse c475f895e8 Create SignalUtilitiesKit 2020-11-11 10:58:56 +11:00
nielsandriesse a3382f41d4 Re-organize files 2020-11-09 10:58:47 +11:00
nielsandriesse b9f2881c9d Implement destination coding 2020-11-08 16:31:48 +11:00
nielsandriesse 28172b4ed2 Create AttachmentUploadJob & AttachmentDownloadJob
Also conform SnodeMessage to NSCoding
2020-11-08 12:34:08 +11:00
nielsandriesse 4b63588f1a Create MessageSendJob & MessageReceiveJob
Also implement message sending notifications & custom TTL for typing indicators
2020-11-08 09:00:10 +11:00
nielsandriesse 21fe9558a4 Partially implement messaging kit encryption & decryption 2020-11-06 19:32:09 +11:00
nielsandriesse 2d618cc6e9 Re-add proof of work 2020-11-06 13:56:26 +11:00
nielsandriesse d735568e94 Partially implement sending pipeline 2020-11-06 13:46:06 +11:00
nielsandriesse 3fe57b7765 Implement read receipt 2020-11-06 11:57:34 +11:00
nielsandriesse 48f166b893 Implement typing indicator proto conversion 2020-11-06 09:49:16 +11:00
nielsandriesse fbc41a857a Stub sending & receiving pipelines 2020-11-06 09:17:05 +11:00
nielsandriesse 74b104af45 Clean 2020-11-05 19:23:05 +11:00
nielsandriesse 10582e0381 Add SSKs to SessionProtocolKit 2020-11-05 17:04:39 +11:00
nielsandriesse c1196a6921 Start SessionMessagingKit 2020-11-05 14:16:45 +11:00
nielsandriesse 9806f1880b Rename various things 2020-11-05 13:39:32 +11:00
nielsandriesse f3753abe5a Create SessionUtilities framework 2020-11-05 12:15:57 +11:00
nielsandriesse 2b1e322832 Create SessionSnodeKit 2020-11-05 12:07:21 +11:00