Skip to content

fix(admin): use full usbDrives[0] object as listPotentialElectionPackagesOnUsbDrive query key#8122

Merged
eventualbuddha merged 3 commits intobrian/multi-usb-apifrom
copilot/sub-pr-8057
Mar 17, 2026
Merged

fix(admin): use full usbDrives[0] object as listPotentialElectionPackagesOnUsbDrive query key#8122
eventualbuddha merged 3 commits intobrian/multi-usb-apifrom
copilot/sub-pr-8057

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

Addresses review feedback on #8057: the queryKey for listPotentialElectionPackagesOnUsbDrive only keyed off mount.type, so swapping to a different drive that was also mounted wouldn't trigger a refetch.

Overview

Use the full usbDrives[0] object as the query key so any drive identity change (devPath, mountPoint, etc.) produces a distinct key and forces React Query to refetch.

// Before
queryKey(usbDrives: UsbDriveInfo[]): QueryKey {
  const mountType = usbDrives[0]?.partitions[0]?.mount.type ?? 'no_drive';
  return ['listPotentialElectionPackagesOnUsbDrive', mountType];
},

// After
queryKey(usbDrives: UsbDriveInfo[]): QueryKey {
  return ['listPotentialElectionPackagesOnUsbDrive', usbDrives[0]];
},

Demo Video or Screenshot

Testing Plan

Checklist

  • I have prefixed my PR title with "VxDesign: ", "VxPollBook: ", or "HWTA: " if my change is specific to one of those products.
  • I have added logging where appropriate for any new user actions.
  • I have added the "user-facing-change" label to this PR, if relevant, to automate an announcement in #machine-product-updates.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] [WIP] Address feedback on multi-USB drive API for VxAdmin implementation fix(admin): use full usbDrives[0] object as listPotentialElectionPackagesOnUsbDrive query key Mar 17, 2026
Copilot AI requested a review from eventualbuddha March 17, 2026 18:49
@eventualbuddha eventualbuddha marked this pull request as ready for review March 17, 2026 21:05
@eventualbuddha eventualbuddha merged commit 2db0699 into brian/multi-usb-api Mar 17, 2026
58 of 59 checks passed
@eventualbuddha eventualbuddha deleted the copilot/sub-pr-8057 branch March 17, 2026 21:06
eventualbuddha added a commit that referenced this pull request Mar 17, 2026
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.

3 participants