Skip to content

Conversation

@nshirley
Copy link
Contributor

@nshirley nshirley commented Oct 23, 2025

Because:

  • There is a chance that ConnectedServicesFactory will return duplicate and/or null id connected devices

This Commit:

  • Adds logic to dedupe records as they're built
  • And fixes a bug where a Map() was used with buffer values, resulting in it always allowing new records even if they were identical
  • And adds tests for the dedupe protection

Closes: FXA-12532

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

Any other information that is important to this pull request.

Because:
 - There is a chance that ConnectedServicesFactory will return
   duplicate and/or null id connected devices

This Commit:
 - Adds logic to dedupe records as they're built
 - And fixes a bug where a Map() was used with buffer values, resulting in
   it always allowing new records even if they were identical
 - And adds tests for the dedupe protection
@nshirley nshirley changed the title chore(fxa-shared): Dedupe ConnectedServicesFactory build chore(fxa-shared): Dedupe ConnectedServicesFactory builder Oct 24, 2025
const result = await route(request);

assert.equal(result.length, 6);
console.debug('Result:', result);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove debug

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