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: added pairIdentifiers service #4269

Merged
merged 7 commits into from
May 15, 2024
Merged

feat: added pairIdentifiers service #4269

merged 7 commits into from
May 15, 2024

Conversation

dovydas55
Copy link
Contributor

@dovydas55 dovydas55 commented May 8, 2024

Explanation

Adding pairing profile functionality to the profile sync SDK.

@metamask/profile-sync-controller/sdk

  • added profile pairing functionality

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@dovydas55 dovydas55 self-assigned this May 8, 2024
@dovydas55 dovydas55 marked this pull request as ready for review May 14, 2024 15:03
@dovydas55 dovydas55 requested a review from a team as a code owner May 14, 2024 15:03
@@ -50,6 +58,36 @@ export class JwtBearerAuth implements SIWEInterface, SRPInterface {
return await this.#sdk.signMessage(message);
}

async pairIdentifiers(pairing: Pair[]): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm...

I'm hesitant if implementations should be done in this combined class vs in the individual implementations.

Context:

  • Combined Class: 1 class; but poor type interface
  • Individual Class: the developer can choose a specific implementation & has great type interface.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes lets move the implementation to the individual classes, that way the better typed implementations can also utilise this method.

Either do this now, or in a separate implementation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Only annoying thing is that the implementation is identical on both implementations, so a bit redundant. (Sadly JS does not support the trait system lol).

Even though there would be duplication, I think it is nicer to have that abstraction.

Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya left a comment

Choose a reason for hiding this comment

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

LGTM.

1 comment on adding the implementation to the grouped class.
Not against it, but originally that grouped class was supposed to be a thin wrapper around the individual implementations.

We can refactor this in another PR.

@dovydas55 dovydas55 merged commit 39b9e5a into main May 15, 2024
143 checks passed
@dovydas55 dovydas55 deleted the NOTIFY-588-pairing branch May 15, 2024 15:44
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.

None yet

2 participants