Skip to content

fix(contacts): fetch-before-update, batch failure reporting, directory-search pagination#128

Merged
omriariav merged 3 commits intomainfrom
fix/contacts-review-fixes
Feb 19, 2026
Merged

fix(contacts): fetch-before-update, batch failure reporting, directory-search pagination#128
omriariav merged 3 commits intomainfrom
fix/contacts-review-fixes

Conversation

@omriariav
Copy link
Owner

Summary

Post-merge review fixes for PR #125 (contacts parity). Addresses issues found by both PR-reviewer and Codex:

  • contacts update: Fetch existing contact before updating to include source metadata required by People API. Fixes potential 400 failedPrecondition errors. Now uses cmd.Flags().Changed() to detect flag intent, allowing empty-string updates to clear fields.
  • batch-create / batch-update: Surface per-item failures with status code and message instead of silently dropping entries where Person is nil. Output now includes failed and failed_count fields.
  • directory-search: Add pagination loop so --max values above 500 (the API page limit) are properly honored.
  • resolve: Distinguish NOT_FOUND (gRPC code 5) from other API errors instead of misclassifying all non-person responses as not_found.
  • docs: Remove phantom --query flag from directory command documentation in both SKILL.md and commands.md.

Test plan

  • go vet ./... clean
  • go test ./... all pass
  • Manual test: gws contacts update with real contact
  • Manual test: gws contacts directory-search --max 600 with Workspace account

🤖 Generated with Claude Code

omriariav and others added 3 commits February 19, 2026 23:38
…directory-search

- contacts update: fetch existing contact first to include source metadata
  required by the People API, fixing potential 400 failedPrecondition errors.
  Also use cmd.Flags().Changed() to detect intent, allowing empty-string updates.
- batch-create/batch-update: surface per-item failures instead of silently
  dropping entries where Person is nil. Output now includes failed/failed_count.
- directory-search: add pagination loop so --max values above 500 are honored.
- resolve: distinguish NOT_FOUND (code 5) from other API errors instead of
  misclassifying all non-person responses as not_found.
- docs: remove phantom --query flag from directory command documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The People API requires person.metadata.sources for UpdateContact.
Without fetching metadata, the prefetch-and-merge approach would still
fail with 400 failedPrecondition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…fields

- Rename `errors` to `apiErrors` in resolve to avoid shadowing the
  built-in errors package identifier.
- Document optional `failed`/`failed_count` output fields for
  batch-create and batch-update in commands.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@omriariav omriariav merged commit 15e07fc into main Feb 19, 2026
1 check failed
@omriariav omriariav deleted the fix/contacts-review-fixes branch February 19, 2026 21:51
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

Comments