Skip to content

fix: populate CopyMask in contacts other delete to fix 400 error#384

Open
rbansal42 wants to merge 1 commit intosteipete:mainfrom
rbansal42:fix/contacts-other-delete-copymask
Open

fix: populate CopyMask in contacts other delete to fix 400 error#384
rbansal42 wants to merge 1 commit intosteipete:mainfrom
rbansal42:fix/contacts-other-delete-copymask

Conversation

@rbansal42
Copy link

Problem

gog contacts other delete fails with:

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

This makes the command completely unusable. Reported in #383.

Root Cause

In deleteOtherContact(), the CopyOtherContactToMyContactsGroup API is called with an empty CopyOtherContactToMyContactsGroupRequest{}. The Google People API requires the CopyMask field — without it, the API returns a 400 error.

Fix

Populate CopyMask with all relevant contact fields:

&people.CopyOtherContactToMyContactsGroupRequest{
    CopyMask: "names,phoneNumbers,emailAddresses,organizations,biographies,urls,addresses,birthdays,events,relations,userDefined",
},

Testing

Build passes (go build ./...). The fix can be verified by running gog contacts other delete against any otherContacts/ resource — it should now successfully copy + delete instead of returning a 400.

Fixes #383

The deleteOtherContact function called CopyOtherContactToMyContactsGroup
with an empty CopyOtherContactToMyContactsGroupRequest{}, but the Google
People API requires the CopyMask field to specify which fields to copy.
Omitting it causes a 400 badRequest error: 'copyMask is required'.

Fix by setting CopyMask to include all relevant contact fields.

Fixes steipete#383
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.

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

2 participants