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

feat: implements irn_batchFetchMessages #4459

Merged
merged 8 commits into from
Apr 22, 2024
Merged

Conversation

ganchoradkov
Copy link
Member

@ganchoradkov ganchoradkov commented Apr 18, 2024

Description

Implemented irn_batchFetchMessages that is called before subscribing to topics so we can sort all pending messages from the mailbox and avoid out of sync messages and improve consistency in handling when a peer comes online and receives bunch of mailbox messages

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • 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?

this test covers exactly this scenario https://github.com/WalletConnect/walletconnect-monorepo/blob/v2.0/packages/web3wallet/test/sign.spec.ts#L142

Checklist

  • I have performed a self-review of my own code
  • 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.

@arein arein added the accepted label Apr 18, 2024
@ganchoradkov
Copy link
Member Author

waiting on WalletConnect/walletconnect-utils#170 to be merged/release so I can bump versions in this PR

);
return await fetchMessages;
} catch (err) {
this.relayer.events.emit(RELAYER_EVENTS.connection_stalled);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the only possible cause for the error?

Copy link
Member Author

Choose a reason for hiding this comment

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

pretty much yes, other failures e.g. in .relayer.request are logged

@bkrem
Copy link
Member

bkrem commented Apr 19, 2024

waiting on WalletConnect/walletconnect-utils#170 to be merged/release so I can bump versions in this PR

Approved ✅

packages/core/src/controllers/subscriber.ts Outdated Show resolved Hide resolved
packages/core/src/controllers/relayer.ts Outdated Show resolved Hide resolved
packages/core/src/controllers/relayer.ts Outdated Show resolved Hide resolved
packages/core/src/controllers/subscriber.ts Outdated Show resolved Hide resolved
packages/core/src/controllers/subscriber.ts Show resolved Hide resolved
packages/core/src/controllers/subscriber.ts Outdated Show resolved Hide resolved
packages/core/src/controllers/relayer.ts Show resolved Hide resolved
@ganchoradkov ganchoradkov marked this pull request as ready for review April 19, 2024 10:28
Copy link
Contributor

@devceline devceline left a comment

Choose a reason for hiding this comment

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

LGTM

packages/core/src/controllers/subscriber.ts Outdated Show resolved Hide resolved
Gancho Radkov added 2 commits April 22, 2024 16:31
@ganchoradkov ganchoradkov merged commit 82298c9 into v2.0 Apr 22, 2024
9 checks passed
@ganchoradkov ganchoradkov deleted the feat/batch_fetch_messages branch April 22, 2024 13:47
@ganchoradkov ganchoradkov mentioned this pull request May 8, 2024
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants