-
Notifications
You must be signed in to change notification settings - Fork 33
[WIP] Initial Session Pro Integration, Query Refactoring and Bug Fixes #616
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
Draft
mpretty-cyro
wants to merge
70
commits into
session-foundation:dev
Choose a base branch
from
mpretty-cyro:feature/libsession-message-wrapping
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[WIP] Initial Session Pro Integration, Query Refactoring and Bug Fixes #616
mpretty-cyro
wants to merge
70
commits into
session-foundation:dev
from
mpretty-cyro:feature/libsession-message-wrapping
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
• Added initial `Network.SessionPro` structure • Wrapped a bunch of session pro types • Cleaned up some of the C interop DSL
• Added the get pro proof request • Added the get pro status request • Cleaned up the API to be closer to the proper structure • Fixed an issue with the add pro payment request
…ession-message-wrapping # Conflicts: # SessionMessagingKit/Jobs/AttachmentUploadJob.swift # SessionMessagingKit/Jobs/MessageSendJob.swift # SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+Groups.swift # SessionMessagingKit/Sending & Receiving/MessageSender.swift # SessionUtilitiesKit/Crypto/CryptoError.swift
• Updated the code to use the libSession function to determine message lengths • Fixed an issue where CTA modal benefits could incorrectly be truncated
…essage-wrapping # Conflicts: # SessionUIKit/Components/SwiftUI/ProCTAModal.swift
…e/libsession-message-wrapping # Conflicts: # Session/Conversations/ConversationVC+Interaction.swift # Session/Conversations/Input View/InputView.swift # Session/Settings/DeveloperSettings/DeveloperSettingsProViewModel.swift # Session/Settings/SettingsViewModel.swift # SessionMessagingKit/Jobs/ReuploadUserDisplayPictureJob.swift # SessionMessagingKit/LibSession/Config Handling/LibSession+Contacts.swift # SessionMessagingKit/LibSession/Config Handling/LibSession+Pro.swift # SessionMessagingKit/LibSession/Config Handling/LibSession+UserProfile.swift # SessionMessagingKit/Sending & Receiving/MessageSender+Convenience.swift # SessionMessagingKit/Utilities/SessionProState.swift # SessionUIKit/Components/SwiftUI/ProCTAModal.swift # SessionUtilitiesKit/General/Feature.swift # SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift
• Refactored the MessageViewModel to be a dumb data types instead of a monolithic query • Refactored the ConversationViewModel due to handle the updated MessageViewModel • Refactored OWSAudioPlayer into Swift • Refactored the OpenGroupManager and OpenGroupManagerCache to be a single actor (CommunityManager), it also holds community state in memory • Removed a bunch of GRDB-specific relationship code (just makes things messy since we have raw SQL elsewhere) • Fixed a bug where the ObservationBuilder could incorrectly run queries in cancelled contexts resulting in potential buggy outputs • Fixed a bug where outgoing voice messages might not be able to be played
• Updated the dev settings to show the different products • Fixed an issue where opening a conversation from global search would result in data missing
…essage-wrapping # Conflicts: # Session.xcodeproj/project.pbxproj # Session/Conversations/ConversationVC+Interaction.swift # Session/Conversations/ConversationVC.swift # Session/Conversations/Settings/ThreadSettingsViewModel.swift # Session/Home/App Review/AppReviewPromptModel.swift # Session/Home/HomeViewModel.swift # Session/Media Viewing & Editing/MessageInfoScreen.swift # Session/Meta/AppDelegate.swift # Session/Settings/DeveloperSettings/DeveloperSettingsProViewModel.swift # Session/Settings/SettingsViewModel.swift # Session/Shared/BaseVC.swift # Session/Utilities/UIContextualAction+Utilities.swift # SessionMessagingKit/Database/Models/SessionThread.swift # SessionMessagingKit/SessionPro/SessionProPaymentScreenContent.swift # SessionMessagingKit/SessionPro/SessionProSettingsViewModel.swift # SessionMessagingKit/SessionPro/SessionProState.swift # SessionMessagingKit/Shared Models/SessionThreadViewModel.swift # SessionNotificationServiceExtension/NotificationServiceExtension.swift # SessionUIKit/Components/Input View/InputView.swift # SessionUIKit/Components/SwiftUI/ProCTAModal.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+CancelPlan.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+Models.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+Purchase.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+Renew.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+RequestRefund.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+UpdatePlan.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen.swift # SessionUIKit/Screens/Settings/SessionProSettings/SessionProPlanUpdatedScreen.swift # SessionUIKit/Style Guide/Constants+Apple.swift # SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift # SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift
• Added logic to handle non-originating accounts • Added explicit SessionPro errors • Moved profile pro decisions into the SessionProManager to consolidate the logic • Resolved a bunch of TODOs • Fixed an issue where a invalid pro key would prevent messages from decoding
…essage-wrapping # Conflicts: # Session/Conversations/ConversationVC+Interaction.swift # Session/Conversations/ConversationVC.swift # Session/Conversations/Settings/ThreadSettingsViewModel.swift # Session/Home/GlobalSearch/GlobalSearchViewController.swift # Session/Meta/AppDelegate.swift # SessionMessagingKit/Open Groups/OpenGroupManager.swift # SessionMessagingKit/Sending & Receiving/MessageReceiver.swift # SessionMessagingKit/Utilities/MessageWrapper.swift
• Tweaked group message deletion to determine admin status via libSession instead of the database (since it now retrieves keys from libSession) • Fixed a bug where interactions may not be able to be marked as deleted if there was an attachment without a downloadUrl
• Added some initial pro revocation list logic • Updated to libSession 1.5.9 • Fixed duplicate file warnings
• Fixed a bug where an invalid thread would be created on fresh install • Fixed a bug where restoring a device could result in the conversation list staying empty
• Fixed a possible deadlock during dependency initialisation • Fixed an issue preventing destroyed/kicked groups from rendering correctly • Fixed an auth issue when creating a new group • Fixed an issue where the input would incorrect allow text entry when the user can't send messages • Fixed an issue where conversations weren't correctly being identified as message requests • Fixed an issue where the empty state in a conversation could end up with the wrong font
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
OpenGroupManagerandOpenGroupManagerCacheinto a singleCommunityManagerSessionThreadViewModelandMessageViewModel(see below for more info)OWSAudioPlayerinto SwiftSessionThreadViewModel Refactor
The
SessionThreadViewModelhas been renamed toConversationInfoViewModeland is now a simple struct (as opposed to a FetchableRecord with a handful of behemoth database queries)The
ConversationInfoViewModelandMessageViewModelnow get initialised with aConversationDataCachewhich is an object that holds a bunch of [ID -> Data] stores for various types that are needed to construct the aforementioned view models. TheConversationDataCachewill generally be populated via theConversationDataHelperwhich, when combined with ourObservableEventsystem, is where the majority of the work for this refactoring has gone. This helper essentially has 4 parts:determineFetchRequirements: Reviews any events which have come through and determines whether anything needs to be fetched from the databaseapplyNonDatabaseEvents: Updates the cached data directly based on delta information included in theObservableEventinstancesfetchFromDatabase: Fetches any data from the database based on the info returned fromdetermineFetchRequirements, this function will also resolve any dependant data that newly fetched objects need if they aren't already in the cachefetchFromLibSession: Retrieves requested data from libSessionUsing the above setup all screens which contain conversation or message data now use these two view models, and can share the state of the view models between each other to reduce the need to refetch data when entering a new screen
Some additional changes included due to the above are:
displayNameRetrieverthroughoutConversationDataHelperConversationDataHelper