Skip to content

Conversation

@torcolvin
Copy link
Collaborator

CBG-4989 don't panic if no _vv but _sync.rev.ver on import

I don't think this critical because I'm not sure how you'd end up in this scenario outside of tests where you have _sync.vv.ver but not _vv. This will backport into 4.0.2 but isn't urgent.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

@torcolvin torcolvin requested a review from gregns1 November 13, 2025 16:53
Copilot AI review requested due to automatic review settings November 13, 2025 16:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a panic condition when importing documents that have _sync.rev.ver but lack the _vv xattr, a scenario that can occur in test environments.

Key Changes:

  • Modified type declaration from interface to concrete pointer type to prevent nil pointer dereference
  • Added test case to verify the fix handles the edge case without panicking

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
db/import_listener.go Changed cv variable type from cvExtractor interface to *rawHLV pointer to safely handle nil case
db/import_test.go Added test that removes _vv xattr after document creation to reproduce and verify the panic scenario

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