-
Notifications
You must be signed in to change notification settings - Fork 83
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
Connection Handler from_parts constructor #743
Connection Handler from_parts constructor #743
Conversation
Signed-off-by: George Mulhearn <gmulhearn@anonyome.com>
Codecov Report
@@ Coverage Diff @@
## main #743 +/- ##
==========================================
- Coverage 54.73% 54.06% -0.67%
==========================================
Files 363 363
Lines 37122 37132 +10
Branches 8089 8074 -15
==========================================
- Hits 20317 20077 -240
- Misses 10832 11111 +279
+ Partials 5973 5944 -29
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Hmm. It may not actually be this simple... As a consumer cannot fully construct a This is because the e.g. @Patrik-Stas I'm unsure of the best solution to this? ^, we could maybe make that |
Hi @gmulhearn-anonyome I am afraid I didn't properly communicate the Connection refactor PR #739 as under the current plan, this PR #743 wouldn't apply anymore, as new If this comes as too sudden breaking change, we can keep Let's first clarify this and then we can address the actual proposal / problem you are trying to solve. |
Oh nice. Thought that might be the case! Ok no worries, I'll need to check in that MR if my issue in connections has been fixed. It ultimately comes down to whether or not the states can be manually reconstructed. Regardless the issue I created still applies for other handlers in vcx. (I.e. they're missing constructors). So let me know if you agree that's an issue |
@gmulhearn
I suspect in this case, the 3 parts you would like to get is
Is that right? I think your proposal makes totally sense given the current state of art. There's few issues few current default serialization formats so I can see why you would want to serialize on your own into a different one. Keep in mind that in relatively soon future (I think in terms of weeks) we would like to deprecate current state machines in favor of their new reimplementation using #739 approach - but this can be separate discussion as how this can be done in a sensible manner to prevent causing too much disruption. It's actually great you bring this up, cause I find de/serialization as one of the top weaknesses of |
Yes true, but IMO it would be ideal also if consumers would be able to use constructors to re-construct their handlers from the barebone data. Would be nice if they could not rely on aries-vcx serialized data at all when constructing. This is because consumers could be migrating data from other sources (e.g. another aries agent), or they are storing their protocol state/data in their own format (which IMO is best practice, as aries-vcx serialization of handlers may not be the exact same as it is now - e.g. in years time from now a serialized So taking the
where This is the case for all handlers as well, even if they had the So I guess the quick-and-easy solution is to add |
@bobozaur changes somewhat solve this problem in connection as well, as all the state objects now have a publicly accessible here's two examples on bobozaur's branch of how a consumer can construct handler's using primitive SSI data which would likely be storing anyway:
So in this example a consumer is able to re-construct their Connection handler using the base SSI primitive data which they would be likely to storing and managing themselves in their own agent. |
If this thread is getting too much, would be good to continue the discussion in this week's call if possible 👌 |
I think a discussion in the weekly call is the best way to go about it, but I'll also provide my two cents here: I believe we should not guarantee a serialization format of the connection and even discourage people from directly accessing the serialized format. Things can still change in terms of the format and it would be best not to make a promise like this unless we are completely sure we won't ever break it. But even then, direct access should not be encouraged and rather working with I'm quite torn between whether we should provide the additional constructor or not. @gmulhearn makes a good point that people can modify the serialized connection and deserialize to get a different state if they really want to and maybe migrating a connection from a different agent does make sense. However, the ability of constructing an arbitrary state sounds like looking for trouble. But it might be just an irrational thought. After all, even if a connection is constructed improperly, it doesn't really do much without the counterpart connection of the other agent being in an improper state. So we might as well make it easy and less-error prone by adding |
Yeah exactly ^. Without going into the nitty gritty right now, we have a particular use case where a handler needs to be restored via protocol data being stored in our own format, and the only way to do that currently is via the connection replica + serialization/deserialization hacky strategy mentioned by Bogdan ^. Of course my particular use case should not inform aries-vcx design, however I imagine this use case will not be that uncommon to anyone building an agent with persistent storage onto of aries-vcx. And IMO since the goal can be accomplished in a hacky/dangerous way currently, we may as well just make it possible in a less hacky and type-safe way via providing constructors. anyway, keen to discuss this further in the call |
handled in typestate PR |
Part of #742 - pending validation of issue from vcx team.