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

[Ref] Use DNS text queries to resolve PCI IDs #3528

Merged
merged 2 commits into from
Feb 6, 2024
Merged

[Ref] Use DNS text queries to resolve PCI IDs #3528

merged 2 commits into from
Feb 6, 2024

Conversation

CommandMC
Copy link
Collaborator

As discussed in #3483

To test this:

  • Open the current Heroic release and navigate to the System Information tab. Note down the name of your GPU.
  • Open this version, navigate to the same tab. The same name as before should be displayed.

I've tested this on both real and virtual machines, and on both Windows and Linux. macOS does not need testing, as detecting GPUs in the first place isn't done there.

Internally, we now keep two CacheStores for (1) vendor names and (2) device names. The vendor name cache is simply indexed by their ID, device names are indexed with either <DeviceSubID>_<VendorSubId>_<DeviceId>_<VendorId>, if there are sub-IDs, or just <DeviceId>_<VendorId> if there aren't. This key format is handy, since replacing the _ with . nets us the DNS query prefix.

Both caches are valid for 7 days. I've toned this down from 30, but the bandwidth used should still be much less than before (since we're just requesting individual IDs).

CC @gollux

This requires #3527, as downloadFile isn't used anymore (so Unimported will fail)


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@CommandMC CommandMC added the pr:ready-for-review Feature-complete, ready for the grind! :P label Feb 5, 2024
@CommandMC CommandMC requested a review from a team February 5, 2024 22:35
@CommandMC CommandMC self-assigned this Feb 5, 2024
@CommandMC CommandMC requested review from arielj, flavioislima, Etaash-mathamsetty, Nocccer and imLinguin and removed request for a team February 5, 2024 22:36
@arielj
Copy link
Collaborator

arielj commented Feb 5, 2024

I'm not sure I understand the reason to clear the cache after 7 days. If the information that's cached already matches my GPU, why would we need to discard it and do a new request?

it's because the name of my device can change in that endpoint?

@CommandMC
Copy link
Collaborator Author

Correct, device names can change (they don't do often, but they might)

7 days might indeed still be too frequent for most use cases, but my layman's guess would be that one of these queries per user every 7 days still is not much at all in terms of data transferred

@gollux
Copy link

gollux commented Feb 5, 2024

I am pretty fine with a couple of requests per 7 days per user.

We only want to clear them if we're *not* upgrading Heroic though (don't
want to cause a request spike when releasing an update)
Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

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

lgtm

@arielj arielj merged commit 1c2740d into main Feb 6, 2024
9 checks passed
@arielj arielj deleted the ref/pci-ids-dns branch February 6, 2024 19:47
@Heroic-Games-Launcher Heroic-Games-Launcher locked and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants