Skip to content

fix: widen vault_id column for ECDSA public keys - #24

Merged
neavra merged 2 commits into
mainfrom
fix/widen-vault-id-column
Apr 8, 2026
Merged

fix: widen vault_id column for ECDSA public keys#24
neavra merged 2 commits into
mainfrom
fix/widen-vault-id-column

Conversation

@neavra

@neavra neavra commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Widens vault_id from varchar(64) to varchar(128) in the device model
  • ECDSA public keys are 66 chars, which exceeds the current 64-char limit
  • Browser extension and agent-backend send raw ECDSA keys as vault_id, causing registration to fail with Data too long for column 'vault_id'
  • GORM AutoMigrate handles the column alteration on startup — no manual migration needed

Related PRs

Deploy this first — the other two PRs depend on this column being widened.

Test plan

  • Verified locally: registration with 66-char ECDSA public key succeeds after change
  • AutoMigrate widens column on startup

🤖 Generated with Claude Code

Summary by CodeRabbit

Bug Fixes

  • Extended vault ID field capacity to support additional credential formats, improving system compatibility.

ECDSA public keys are 66 chars but vault_id was varchar(64).
Browser extension and agent-backend send raw ECDSA keys as vault_id,
causing registration failures. GORM AutoMigrate widens on startup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2fbba7f5-b40b-4cf7-b899-f3e82c55f8f4

📥 Commits

Reviewing files that changed from the base of the PR and between c0bd569 and ceb84f9.

📒 Files selected for processing (1)
  • models/device.go
✅ Files skipped from review due to trivial changes (1)
  • models/device.go

Walkthrough

Widened the Device model's VaultId GORM column type from varchar(64) to varchar(128) and added a field comment describing acceptable VaultId formats; other tags (not null, uniqueIndex:idx_vault_party, json:"vault_id", binding:"required") remain unchanged.

Changes

Cohort / File(s) Summary
Device model
models/device.go
Changed VaultId GORM column type varchar(64)varchar(128) and added a field comment clarifying allowed VaultId formats; preserved not null, uniqueIndex:idx_vault_party, json:"vault_id", and binding:"required" tags.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: widening the vault_id column to accommodate ECDSA public keys, which is the core issue addressed in this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/widen-vault-id-column

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 and usage tips.

@neavra
neavra marked this pull request as ready for review April 7, 2026 07:06

@NeOMakinG NeOMakinG 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.

Code Review

Minimal and correct — widens VaultId from varchar(64) to varchar(128). ECDSA public keys are 66 chars, so 128 gives adequate headroom. GORM AutoMigrate handles varchar widening safely. No other columns need updating.

Verdict

APPROVE — no issues found.

🤖 Review + QA by vultisig-ops

@gomesalexandre gomesalexandre 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.

Conceptual review - no runtime testing

Reviewing as part of the full notification chain (this → agent-backend#84 → vultisig-sdk#211). Haven't wired things up for runtime testing.

The good

  • Simple, surgical fix - one line change
  • GORM AutoMigrate handles the column alteration on startup, no manual migration needed
  • 128 chars gives headroom beyond the 66-char ECDSA keys

One inline comment below.

Comment thread models/device.go
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@neavra
neavra merged commit 08ea47c into main Apr 8, 2026
2 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.

3 participants