Create action that reads comments from docs#482
Conversation
Greptile OverviewGreptile SummaryThis PR adds a new action Key Changes:
Critical Issue:
Confidence Score: 1/5
Important Files Changed
|
| res.data.comments?.map((c: any) => ({ | ||
| commentId: c.commentId, |
There was a problem hiding this comment.
Google Drive API returns id not commentId. This will cause all comment IDs to be undefined.
| res.data.comments?.map((c: any) => ({ | |
| commentId: c.commentId, | |
| res.data.comments?.map((c: any) => ({ | |
| commentId: c.id, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/actions/providers/google-oauth/readCommentsOnDoc.ts
Line: 40:41
Comment:
Google Drive API returns `id` not `commentId`. This will cause all comment IDs to be undefined.
```suggestion
res.data.comments?.map((c: any) => ({
commentId: c.id,
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Yes, you're correct. The Google Drive API returns id not commentId. Both line 40 and line 55 need to be fixed:
| res.data.comments?.map((c: any) => ({ | |
| commentId: c.commentId, | |
| commentId: c.id, | |
| content: c.content, | |
| createdTime: c.createdTime, | |
| modifiedTime: c.modifiedTime, | |
| resolved: c.resolved, | |
| author: c.author | |
| ? { | |
| displayName: c.author.displayName, | |
| emailAddress: c.author.emailAddress, | |
| me: c.author.me, | |
| } | |
| : undefined, | |
| quotedFileContent: c.quotedFileContent, | |
| replies: | |
| c.replies?.map((r: any) => ({ | |
| replyId: r.id, |
The API response uses id for both comments and replies, but your schema correctly expects commentId and replyId in the output.
| quotedFileContent: c.quotedFileContent, | ||
| replies: | ||
| c.replies?.map((r: any) => ({ | ||
| replyId: r.replyId, |
There was a problem hiding this comment.
Google Drive API returns id not replyId for replies.
| replyId: r.replyId, | |
| replyId: r.id, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/actions/providers/google-oauth/readCommentsOnDoc.ts
Line: 56:56
Comment:
Google Drive API returns `id` not `replyId` for replies.
```suggestion
replyId: r.id,
```
How can I resolve this? If you propose a fix, please make it concise.| nextPageToken: res.data.nextPageToken, | ||
| }; | ||
| } catch (error) { | ||
| console.error("Error reading comments on Google Doc", error); |
There was a problem hiding this comment.
Error object may contain sensitive information and should be handled carefully. Consider logging only non-sensitive error details.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/actions/providers/google-oauth/readCommentsOnDoc.ts
Line: 76:76
Comment:
Error object may contain sensitive information and should be handled carefully. Consider logging only non-sensitive error details.
How can I resolve this? If you propose a fix, please make it concise.
No description provided.