Skip to content

fix(usb): suppress reattach prompt after intentional detach - #22

Closed
Afcoo wants to merge 5 commits into
mainfrom
fix/usb-detach-reprompt
Closed

fix(usb): suppress reattach prompt after intentional detach#22
Afcoo wants to merge 5 commits into
mainfrom
fix/usb-detach-reprompt

Conversation

@Afcoo

@Afcoo Afcoo commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • recognize the expected AccessoryAccess disconnect and reconnect caused by intentional VM passthrough release
  • suppress the duplicate automatic attach prompt while keeping the returned device available and selected
  • reuse the cached descriptor during disconnect handling and remove unused attach-attempt tracking

Verification

  • xcodebuild project and scheme discovery
  • plist, entitlement, and scheme XML validation
  • git diff --check
  • unsigned macOS Debug build with Xcode 27 beta

Signed USB passthrough behavior still requires verification with the installed signed app and a real RNDIS device.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T14:37:48.925891Z 49f35aa Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Afcoo Afcoo changed the title Fix USB reattach prompt after intentional detach fix(usb): suppress reattach prompt after intentional detach Aug 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4967302a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ThruRNDIS/Coordinators/USBAccessoryCoordinator.swift
Comment thread ThruRNDIS/Coordinators/USBAccessoryCoordinator.swift
@Afcoo

Afcoo commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16dc69e395

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ThruRNDIS/Coordinators/USBAccessoryCoordinator.swift Outdated
@Afcoo

Afcoo commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 353ba90b40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ThruRNDIS/Coordinators/USBAccessoryCoordinator.swift Outdated
@Afcoo

Afcoo commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49f35aaa1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +756 to +757
guard expectedAccessoryReenumeration.deviceDescriptorHash
== record.deviceDescriptorHash else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not suppress a different identical USB device

When another unit of the same USB model connects during the three-second re-enumeration window, its device descriptor is typically byte-identical because the descriptor contains only the serial-string index, not the unit's serial value. This comparison therefore consumes the old device's expectation and inserts the new registry ID into announcedAccessoryIDs, permanently suppressing the new device's only attachment prompt even though it was never approved; correlate the reconnect with device identity or topology rather than this model-level hash alone.

AGENTS.md reference: AGENTS.md:L203-L208

Useful? React with 👍 / 👎.

@Afcoo Afcoo closed this Aug 29, 2026
@Afcoo
Afcoo deleted the fix/usb-detach-reprompt branch August 30, 2026 17:33
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