Skip to content

Unify Electron printer discovery targets#616

Open
kilbot wants to merge 1 commit into
nextfrom
fix/unify-printer-device-key
Open

Unify Electron printer discovery targets#616
kilbot wants to merge 1 commit into
nextfrom
fix/unify-printer-device-key

Conversation

@kilbot

@kilbot kilbot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a shared packages/printer/src/transport/device-key.ts codec for serial/usb/winspool/cloud/system/local target IDs
  • consume full DiscoveredPrinter[] from Electron USB/serial IPC instead of renderer-side restamping
  • report winspool: as system-backed while keeping USB/Bluetooth tab membership key-based via shared predicates
  • update the Electron submodule pointer to the companion IPC/transport changes

Design decisions

  • The prefix grammar is centralized in device-key.ts; malformed USB and empty serial/winspool keys parse to unknown and callers keep throwing their existing errors.
  • serial: remains connectionType: 'bluetooth' for discovery because it represents OS-paired Bluetooth Classic and must stay visible in Bluetooth UX.
  • winspool: maps to connectionType: 'system' because it is an OS spooler queue; USB picker inclusion is now based on the parsed device key rather than a false USB label.

Companion PRs

Verification

  • cd packages/printer && ../../node_modules/.bin/tsc --noEmit
  • cd apps/electron && pnpm ts:check
  • cd packages/printer && ../../node_modules/.bin/vitest run src/hooks/use-printer-discovery.electron.test.tsx src/transport/__tests__/device-adapter.electron.test.ts src/transport/__tests__/device-key.test.ts
  • cd apps/electron && pnpm run test:serial-printer && pnpm run test:winspool-printer && pnpm run test:printer-discovery
  • cd /Users/kilbot/Projects/monorepo-v2/.worktrees/unify-printer-device-key && pnpm lint
  • cd apps/electron && pnpm lint

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@kilbot, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 17 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 35fe1396-be5e-4a80-be1c-81976c055e99

📥 Commits

Reviewing files that changed from the base of the PR and between e7fc7a1 and 9ba4fe5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • apps/electron
  • packages/core/src/screens/main/settings/printer/add-printer.electron.tsx
  • packages/core/src/screens/main/settings/printer/dialog/connection/bluetooth-device-picker.tsx
  • packages/core/src/screens/main/settings/printer/dialog/connection/discovered-printer-filters.ts
  • packages/core/src/screens/main/settings/printer/dialog/connection/os-printers-section.test.tsx
  • packages/core/src/screens/main/settings/printer/dialog/connection/os-printers-section.tsx
  • packages/core/src/screens/main/settings/printer/dialog/connection/usb-device-picker.tsx
  • packages/printer/package.json
  • packages/printer/src/hooks/use-printer-discovery.electron.test.tsx
  • packages/printer/src/hooks/use-printer-discovery.electron.ts
  • packages/printer/src/transport/__tests__/device-key.test.ts
  • packages/printer/src/transport/device-adapter.electron.ts
  • packages/printer/src/transport/device-key.ts
  • packages/printer/src/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/unify-printer-device-key

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Deployment Summary

Item Status
Preview URL https://wcpos--9dr8pk0kh2.expo.app
E2E Tests ✅ Passed
Commit 60422ae

🔗 Quick Links


🤖 Updated by GitHub Actions

@kilbot kilbot changed the base branch from main to next June 17, 2026 22:05
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.

1 participant