Skip to content

fix(auth): bound device match codes to eight letters - #535

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
RXWatcher:fix/match-code-length
Aug 3, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
RXWatcher:fix/match-code-length

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Fire TV's phone-confirmation card can clip long human-readable device match codes such as SPRUCE TRAIL. This is a Fire TV rc.1+4 QA follow-up; no issue was filed.

Approach

  • Restrict generated adjective/noun pairs to combinations with at most eight letters total (spaces excluded).
  • Retain 240 possible phrases, above the 128-combination safety floor.
  • Keep the existing API contract and confirmation flow unchanged.
  • Coordinate with the Android client change, which also keeps legacy longer codes visually compatible.

Testing

  • go test ./internal/auth -count=1
  • go test ./internal/auth ./internal/api/handlers -count=1
  • make verify-local-paths
  • pnpm run lint — 0 errors; 160 existing warnings
  • pnpm run format:check
  • pnpm run build
  • make lint — repository-wide baseline remains red with 303 pre-existing issues, as documented in AGENTS.md; neither touched file was reported

AI Disclosure

  • Tool(s): OpenAI Codex
  • Model(s): GPT-5.6
  • Involvement: Implementation, tests, verification, commit, and PR drafting under maintainer direction.
  • Adversarial review: Independent review found no blocking server issues and verified the length bound, 240-combination space, and API compatibility.

Checklist

  • I ran an adversarial AI review and addressed all findings.
  • I ran all repository verify commands successfully. (make lint remains blocked by the documented pre-existing repository baseline; focused tests and all other applicable gates above pass.)
  • I added tests for the match-code length and combination-count guarantees.

Summary by CodeRabbit

  • Bug Fixes

    • Updated device login match codes to use shorter, curated words, improving compatibility with the eight-letter limit and making codes easier to enter.
  • Tests

    • Added coverage to verify match-code word lengths and ensure exactly 240 valid adjective-and-noun combinations for reliable device matching.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 50f8646a-e892-40a5-abb0-32e4966d1411

📥 Commits

Reviewing files that changed from the base of the PR and between b49ac2e and 61e8545.

📒 Files selected for processing (2)
  • internal/auth/device_login_words.go
  • internal/auth/device_login_words_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/auth/device_login_words.go

📝 Walkthrough

Walkthrough

The device login adjective and noun pools now use shorter curated lists. A test verifies that every combination stays within eight letters and that the lists provide exactly 240 combinations.

Changes

Device Login Match Codes

Layer / File(s) Summary
Curated word pools and validation
internal/auth/device_login_words.go, internal/auth/device_login_words_test.go
The word pools were replaced with shorter curated lists. The test checks the eight-letter limit and exact combination count.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: limiting device match codes to eight letters.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/auth/device_login_words_test.go`:
- Around line 17-18: Update the combinations assertion in the device match
word-list test to require at least 240 combinations instead of 128, preserving
the intended 12-adjective by 20-noun pool size and collision resistance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 79a06b6e-5aa9-4a04-b949-56be14d86918

📥 Commits

Reviewing files that changed from the base of the PR and between 2dedf3f and b49ac2e.

📒 Files selected for processing (2)
  • internal/auth/device_login_words.go
  • internal/auth/device_login_words_test.go

@Quick104
Quick104 merged commit c1cac4e into Silo-Server:main Aug 3, 2026
8 checks passed
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.

2 participants