Updated intake logic of incoming relay messages so they are processed by Sign Client one by one instead of all at the same time. The old approach was resulting in conflicts when messages were dependent on each other such as session_update adding new chain to the session and session_eventinstructing the client to switch to that new chain. In the above case, the session_event must be processed after the session_update has finished the update, else the client has no knowledge of that new chain.
Additionally, implemented relayMessageCache that stores any messages received while the client is still initializing and the messages are processed after init has finished. This allows implementing apps to setup all event listeners and not miss events
Type of change
[ ] Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Draft PR (breaking/non-breaking change which needs more work for having a proper functionality [Mark this PR as ready to review only when completely ready])
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
How has this been tested?
dogfooding
Checklist
[x] I have performed a self-review of my own code
[x] My changes generate no new warnings
[ ] Any dependent changes have been merged and published in downstream modules
Additional Information (Optional)
Please include any additional information that may be useful for the reviewer.
Description
Updated intake logic of incoming relay messages so they are processed by Sign Client one by one instead of all at the same time. The old approach was resulting in conflicts when messages were dependent on each other such as
session_update
adding new chain to the session andsession_event
instructing the client to switch to that new chain. In the above case, thesession_event
must be processed after thesession_update
has finished the update, else the client has no knowledge of that new chain.Additionally, implemented
relayMessageCache
that stores any messages received while the client is still initializing and the messages are processed after init has finished. This allows implementing apps to setup all event listeners and not miss eventsType of change
How has this been tested?
dogfooding
Checklist
Additional Information (Optional)
Please include any additional information that may be useful for the reviewer.