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

πŸ‘” (webhid) [NO-ISSUE]: Update reconnection error sending #631

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

valpinkman
Copy link
Member

πŸ“ Description

Check for the timing between reconnection before sending an error everytime.

❓ Context

  • JIRA or GitHub link: [NO-ISSUE]
  • Feature:

βœ… Checklist

Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.

  • Covered by automatic tests
  • Changeset is provided
  • Impact of the changes:
    • list of the changes

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.

@valpinkman valpinkman requested a review from a team as a code owner January 24, 2025 10:06
Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
device-sdk-ts-sample βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jan 24, 2025 5:09pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
doc-device-management-kit ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 5:09pm

Copy link
Contributor

github-actions bot commented Jan 24, 2025

Messages
βœ… Danger: All checks passed successfully! πŸŽ‰

Generated by 🚫 dangerJS against b839078

Copy link

@smartine-ledger smartine-ledger left a comment

Choose a reason for hiding this comment

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

I don't see an update of the current WebHidDeviceConnection.

In addition : Open Close Principle Violation. You can instead decorate WebHidDeviceConnection by adding a new implementation instead of modifying the class. ⬇️

class TimeSinceDeviceConnection implements DeviceConnection {
  private delegate: DeviceConnection;
  constructor(
    deviceConnection
  ){
      delegate = deviceConnection
  }
  ...
}

Pros :

  • This way we can add this feature for any DeviceConnection in the future if we want to
  • Avoid breaking the current unit test of WebHidDeviceConnection.

Copy link

@smartine-ledger smartine-ledger left a comment

Choose a reason for hiding this comment

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

Sorry. I read your code too fast. My bad. Forget about the OCP violation but why does the UT have not been updated?

@valpinkman valpinkman changed the title πŸ‘” (webhid): [NO-ISSUE] Update reconnection error sending πŸ‘” (webhid) [NO-ISSUE]: Update reconnection error sending Jan 24, 2025
@valpinkman
Copy link
Member Author

Sorry. I read your code too fast. My bad. Forget about the OCP violation but why does the UT have not been updated?

@smartine-ledger I should have left the PR as draft for now. I'm testing the solution on LLD to make sure it works then I will fix all the tests and finish the PR

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