Unified state#78
Draft
mpretty-cyro wants to merge 25 commits into
Draft
Conversation
Cleaned up the send and store hooks Added a batch merge function Added the ability to suppress triggering hooks (for use when triggering multiple changes at once) Added a function to handle the response from sending the 'send' hook data to the swarm Added code to route the config logging to it's parent state logger (if available and an explicit logger hasn't been set) Extracted the state C wrapper into it's own file to keep the main logic cleaner
# Conflicts: # src/session_encrypt.cpp
Moved the state-based functions back into their respective cpp files (class was getting too large) UserGroups & ConvoInfoVolatile C APIs running via the state object
Added a 'load_group_admin_key' function to make the relevant changes needed when getting promoted to admin. Fixed an issue where failing to handle a '_send' response wasn't setting the state error correctly. Fixed an issue where the 'prepare_push' wasn't signing group config requests correctly.
Fixed key supplement request verification data Fixed an issue where functions which triggered the send hook and had their own callbacks weren't reporting send failures correctly
jagerman
reviewed
Feb 28, 2024
Collaborator
Author
|
Converting this back to a draft as it'll require a number of changes to be usable again |
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
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.
The goal of this PR is to consolidate the different config object types behind a single
Stateclass so clients only need to hold on to a single object instead of juggling multipleConfigobjects.This PR also attempts to abstract as much of the config change/update loop as it currently can via generic hooks (
on_send/on_store) and bulk processing methods (state.merge()).In the future this class can be extended to include individual functions which result in changes across multiple configs in order to simplify the interface for the clients (eg. adding a member to a group).