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 duplicating key error for peers #956

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

asiia-trilitech
Copy link
Contributor

@asiia-trilitech asiia-trilitech commented Mar 12, 2024

Proposed changes

DApp might have the same name, but different beacon instances.
E. g. on mainnet & ghostnet, or when trying to connect from different browsers.

SenderId is unique for each beacon instance of a dApp, so using it as a key solves this problem.

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

Connect to the same dApp from different browsers. Check console for errors.

Screenshots

Before Now
Screenshot 2024-03-12 at 14 00 38 Screenshot 2024-03-12 at 14 02 27

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

@@ -88,6 +88,34 @@ describe("<BeaconPeers />", () => {
}
});

it("resolves duplicating name for different peer connections", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Imo the test is redundant. Have you seen it fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, with the previous key `key={peerInfo.name}``

I can remove the test if you think we don't need it

@asiia-trilitech asiia-trilitech force-pushed the fix-duplicating-key-error-for-peers branch from ced9c34 to 388f697 Compare March 13, 2024 13:01
Copy link

github-actions bot commented Mar 13, 2024

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 84.53% 2940/3478
🟡 Branches 78.07% 993/1272
🟢 Functions 82.39% 898/1090
🟢 Lines 84.29% 2779/3297

Test suite run success

1182 tests passing in 162 suites.

Report generated by 🧪jest coverage report action from 428df22

@asiia-trilitech asiia-trilitech force-pushed the fix-duplicating-key-error-for-peers branch from 388f697 to 428df22 Compare March 13, 2024 13:30
@asiia-trilitech asiia-trilitech merged commit 2fffd24 into main Mar 13, 2024
4 checks passed
@asiia-trilitech asiia-trilitech deleted the fix-duplicating-key-error-for-peers branch March 13, 2024 13:46
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