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(llm): 🩹 do not re-count devices multiple time after upgrades #9244

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

thesan
Copy link
Contributor

@thesan thesan commented Feb 14, 2025

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

📝 Description

Context

In #9109 devices are added to the store in settings.seenDevices which is supposed to be a uniq device array. However to identify the devices uniquely the reducer uses DeviceModelInfo["deviceInfo"]["targetId"] which actually identifies the firmware version. While discussing the issue the device team pointed out that there is no way to uniquely identify a device.

Fix

As an approximation this PR stores for each model only the last connected device into settings.seenDevices. Then devices are counted based on:

  • ble.knownDevices + (each model in settings.seenDevices but not in ble.knownDevices)

❓ Context


🧐 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.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@thesan thesan requested a review from a team as a code owner February 14, 2025 17:23
Copy link

vercel bot commented Feb 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Feb 14, 2025 5:24pm
native-ui-storybook ⬜️ Ignored (Inspect) Feb 14, 2025 5:24pm
react-ui-storybook ⬜️ Ignored (Inspect) Feb 14, 2025 5:24pm
web-tools ⬜️ Ignored (Inspect) Feb 14, 2025 5:24pm

@live-github-bot live-github-bot bot added the mobile Has changes in LLM label Feb 14, 2025
Copy link
Contributor

@LucasWerey LucasWerey left a comment

Choose a reason for hiding this comment

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

LGTM

@thesan thesan added this pull request to the merge queue Feb 17, 2025
Merged via the queue into develop with commit 76de7af Feb 17, 2025
48 of 50 checks passed
@thesan thesan deleted the fix/llm-seen-devices branch February 17, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants