-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: Basic Messages V2 for DIDComm V2 #1546
base: feat/didcomm-v2
Are you sure you want to change the base?
feat: Basic Messages V2 for DIDComm V2 #1546
Conversation
Signed-off-by: Ariel Gentile <[email protected]>
Signed-off-by: Ariel Gentile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming basic message to v1basicmessage seems like a breaking change? Maybe we can export both with and without prefix (alias) and remove without prefix in next release
|
||
@injectable() | ||
export class BasicMessagesApi { | ||
private basicMessageService: BasicMessageService | ||
export class BasicMessagesApi<BMPs extends BasicMessageProtocol[]> implements BasicMessagesApi<BMPs> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's needed to register the protocols dynamically in this case? It's consistent with issue and prove, but those have reasons to not support e.g. v1 (anoncreds only).
But if both v1 and v2 are registered by default, there's no reason to not make it configurable i guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern was also followed in message pickup, I think mainly to allow:
- Adding new protocol versions (or override behaviour of some of them) without the need of changing AFJ core
- Creating 'pure DIDComm V2' agents where only the newer protocols are supported (this is the case if you are using a Wallet that does not support legacy DIDComm packing/unpacking). Also pure DIDComm V1 agents (e.g. Indy SDK or a browser wallet like this one)
For the second case, I think it will be useful to think about a "BaseProtocol" class/interface that forces protocols to indicate DIDComm versions where it is applicable for, and probably the same for Wallet (declare DIDComm versions supported), in order to register protocols only if the wallet is capable of handling messages for it.
Do you think I'd need also to duplicate |
Signed-off-by: Ariel Gentile <[email protected]>
Signed-off-by: Ariel Gentile <[email protected]>
Signed-off-by: Ariel Gentile <[email protected]>
Signed-off-by: Ariel Gentile <[email protected]>
Yeah this is getting into complexities. I'm not sure ... Technically it's a breaking change, and it can result in issues in existing deployments. If we want to be on the safe side, we should push this in 0.5. If you don't use v2 it will never actually contain it in the event, but TS doesn't care about that... So yes, maybe we should create an event type with only v1 message, and another one with both. Then in the next version we remove the old one in favour of the new one. Then we don't have a breaking change :) |
I think if we stick to this 'non-breaking' strategy, for the moment we can simply avoid touching anything in Might that work for the moment? |
Signed-off-by: Ariel Gentile <[email protected]>
Signed-off-by: Ariel Gentile <[email protected]>
Refactor Basic Messages modules to support both V1 and V2 protocols. At the moment, in order to not introduce breaking changes in API level, when messages are sent, the framework determines whether to use 1.0 or 2.0 according to connection's DIDComm version.
Some remaining work (either for a further PR or to discuss here):
Edit: Marked as Draft again as it will be dependent on #1576 and support Basic Messages V2 in both DIDComm V1 and DIDComm V2