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

Interleaved Message Handling and Frame Size handling in Decrypt #14

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

sjdean
Copy link

@sjdean sjdean commented Feb 2, 2022

Rework message handling.

Essentially, OpenAuto uses one Messenger between each service, but each service is running on a specific channel which is passed to messenger under enqueueReceive.

Promises are being used as Observables so when we find an interleaved frame, we're resolving a promise on a message for a different channel. Although the previous implementation worked, it didn't see well with the concept of promises.

What I have tried to implement here, is to ensure we only resolve the original message only and anything else we send back via an interleaved Frame Handler.

We probably need to look at what we do with the interleaved frame - as it needs to get back to the appropriate calling service. Perhaps we could make Messenger service aware and convert the promises to observables, so that Messenger can basically pass information directly into the appropriate Service by Channel Id rather than doing resolve()

also didn't like the Cryptor implementation that seemed to blindly read from the buffer regardless of Frame Size.

Added Frame Size handling to decrypt();

Simon.Dean added 5 commits January 31, 2022 13:46
Promises are being used as Observables and when we hit an interleaved frame, we're resolving a promise on a message for a different channel. Although previous way worked, it was somewhat wrong.

We have tried to ensure here we resolve the original message only and anything else we send back via an interleaved Frame Handler.

Ideally we should then work to ensure we get the interleaved message to the appropriate channel. We'll have a look to setup an interleaved messaged handler that we can send messages up to the chain, or possibly better yet, turn the Messenger/MessageInStream to be responsible for sending to the appropriate service through observables.
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.

1 participant