Skip to content

[BUG] Avoid registering duplicated device when the status is flipping to compliant#2972

Merged
tofikwest merged 2 commits into
mainfrom
chas/device-duplication-bug
May 29, 2026
Merged

[BUG] Avoid registering duplicated device when the status is flipping to compliant#2972
tofikwest merged 2 commits into
mainfrom
chas/device-duplication-bug

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 29, 2026

This is an automated pull request to merge chas/device-duplication-bug into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Prevents duplicate device records when a device first registers without a serial and later reports one. The API now adopts the original serial-less row, and the macOS agent reads the serial more reliably.

  • Bug Fixes
    • API: In registerWithSerial, adopt an existing device with serialNumber=null scoped by hostname, member, and org before creating a new record; existing serial matches are updated in place.
    • Agent (macOS): Switch serial parsing to awk '{print $NF; exit}' to handle both “Serial Number” formats and avoid empty reads that caused duplicates.
    • Tests: Added coverage for orphan adoption, no-orphan create, existing serial update, and same-member scoping.

Written for commit 85f0b1e. Summary will update on new commits.

Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment May 29, 2026 8:00pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped May 29, 2026 8:00pm
portal Skipped Skipped May 29, 2026 8:00pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@chasprowebdev chasprowebdev changed the title [dev] [chasprowebdev] chas/device-duplication-bug [BUG] Avoid registering duplicated device when the status is flipping to compliant May 29, 2026
@chasprowebdev
Copy link
Copy Markdown
Contributor

@cubic-dev-ai ultrareview

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented May 29, 2026

@cubic-dev-ai ultrareview

@chasprowebdev Starting ultrareview - a deeper analysis than a regular review. I'll post findings when complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

Ultrareview completed in 3m 12s

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit 27e926e into main May 29, 2026
17 checks passed
@tofikwest tofikwest deleted the chas/device-duplication-bug branch May 29, 2026 20:18
@tofikwest
Copy link
Copy Markdown
Contributor

approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants