Skip to content

Bug: contacts other delete fails with "copyMask is required" (400 badRequest) #383

@rbansal42

Description

@rbansal42

Bug Report

Version: v0.11.0 (91c4c15)

Command

gog contacts other delete otherContacts/<resourceName> --account user@gmail.com --force

Error

Google API error (400 badRequest): copyMask is required. Please specify one or more valid paths.

Root Cause

Found in internal/cmd/contacts_directory.go — the deleteOtherContact() function:

copied, err := otherSvc.OtherContacts.CopyOtherContactToMyContactsGroup(
    resourceName,
    &people.CopyOtherContactToMyContactsGroupRequest{},
).Do()

The CopyOtherContactToMyContactsGroupRequest is passed empty, but the Google People API requires the CopyMask field to specify which fields to copy. Passing an empty struct triggers the 400 copyMask is required error.

Fix

Populate CopyMask with the relevant fields:

copied, err := otherSvc.OtherContacts.CopyOtherContactToMyContactsGroup(
    resourceName,
    &people.CopyOtherContactToMyContactsGroupRequest{
        CopyMask: "names,phoneNumbers,emailAddresses,organizations,biographies",
    },
).Do()

Workaround

None available via CLI. The contacts other delete command is completely broken for all users.

Reproduction

  1. Have any otherContacts/ entries (auto-populated from Gmail interactions)
  2. Run gog contacts other delete otherContacts/<id> --account you@gmail.com --force
  3. Observe 400 error

Impact

Any workflow that tries to clean up "Other Contacts" duplicates via gog is blocked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions