-
Notifications
You must be signed in to change notification settings - Fork 981
Open
Labels
Description
Description
When creating a comment on a Google Docs file using gws drive comments create with an anchor field, the comment is posted successfully (HTTP 200) but appears in the Google Docs UI as "Original content deleted" instead of being anchored to the specified text.
Steps to Reproduce
gws drive comments create \
--params '{"fileId": "<DOC_ID>", "fields": "id,content,anchor,quotedFileContent"}' \
--json '{
"content": "Hello",
"quotedFileContent": {
"mimeType": "text/plain",
"value": "Overview"
},
"anchor": "{\"r\":\"head\",\"a\":[{\"lt\":\"b\",\"lv\":\"Overview\"}]}"
}'Expected Behavior
The comment should be anchored to the matching text in the document, or the CLI/docs should clearly indicate that anchored comments are not supported for Google Docs files via the API.
Actual Behavior
The API returns a 200 with the anchor saved, but the comment appears in the Google Docs UI as "Original content deleted" — no text is highlighted and the anchor has no visible effect.
Additional Context
- This appears to be a known Google Drive API limitation: for Google Workspace editor files (Docs, Sheets, Slides), the
anchorfield is saved but ignored by the editor UI. See the official docs: "The anchor is saved and returned when retrieving the comment, however Google Workspace editor apps treat these comments as un-anchored comments." - It would be helpful if
gwssurfaced a warning when usinganchoron aapplication/vnd.google-apps.kix(Google Docs) file, since the result is misleading. gwsversion:0.4.4
Reactions are currently unavailable