Skip to content

feat: added pairIdentifiers service#4269

Merged
dovydas55 merged 7 commits intomainfrom
NOTIFY-588-pairing
May 15, 2024
Merged

feat: added pairIdentifiers service#4269
dovydas55 merged 7 commits intomainfrom
NOTIFY-588-pairing

Conversation

@dovydas55
Copy link
Copy Markdown
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 May 14, 2024 15:03
return await this.#sdk.signMessage(message);
}

async pairIdentifiers(pairing: Pair[]): Promise<void> {
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@Prithpal-Sooriya Prithpal-Sooriya May 15, 2024

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
Copy Markdown
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
Copy Markdown
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
@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.

2 participants