Skip to content
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

fix(core): send messages now takes a connection id #491

Merged

Conversation

berendsliedrecht
Copy link
Contributor

Signed-off-by: Berend Sliedrecht [email protected]

@berendsliedrecht berendsliedrecht requested a review from a team as a code owner October 19, 2021 13:03
public async sendMessage(connection: ConnectionRecord, message: string) {
public async sendMessage(connectionId: string, message: string) {
const connection = await this.connectionService.getById(connectionId)

const outboundMessage = await this.basicMessageService.send(message, connection)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're on it:

Not sure if this is 100% valid code, but the basic message service is still creating the outbound message which in other modules is handled at the module layer

Suggested change
const outboundMessage = await this.basicMessageService.send(message, connection)
const basicMessage = await this.basicMessageService.createBasicMessage(content)
const outboundMessage = createOutboundMessage(basicMessage, connection)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check it!

Copy link
Contributor Author

@berendsliedrecht berendsliedrecht Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimoGlastra I implemented your suggested change, however the createMessage requires a connectionRecord/connectionId to initialize and save a basicMessageRecord.

See my proposed solution in the latest commit.

@berendsliedrecht berendsliedrecht changed the title fix: send messages now takes a connection id fix(core): send messages now takes a connection id Oct 19, 2021
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TimoGlastra TimoGlastra merged commit ed9db11 into openwallet-foundation:main Oct 20, 2021
@berendsliedrecht berendsliedrecht deleted the fix/send-message branch August 31, 2022 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants