fix: avoid duplicate gh view bodies
This commit is contained in:
@@ -128,7 +128,9 @@ export function selectedIssueJson(issue: GitHubIssue, comments: GitHubComment[]
|
||||
const summary = issueSummary(issue);
|
||||
const selected: Record<string, unknown> = {};
|
||||
for (const field of fields) {
|
||||
if (field === "comments") {
|
||||
if (field === "body") {
|
||||
continue;
|
||||
} else if (field === "comments") {
|
||||
selected.comments = (comments ?? []).map(options.includeFullCommentBodies === true ? commentSummary : compactIssueViewCommentSummary);
|
||||
} else {
|
||||
selected[field] = summary[field];
|
||||
@@ -189,7 +191,13 @@ export async function issueRead(repo: string, token: string, issueNumber: number
|
||||
json: selectedIssueJson(issue, comments, jsonFields, { includeFullCommentBodies }),
|
||||
compatibility: {
|
||||
legacyJsonBodyPath: includeBody ? ".data.issue.body" : null,
|
||||
bodyPath: includeBody ? ".data.issue.body" : null,
|
||||
omittedDuplicateBodyPath: includeBody ? ".data.json.body" : null,
|
||||
duplicateBodyOmitted: includeBody,
|
||||
bodyOmitted: !includeBody,
|
||||
bodyMigrationHint: includeBody
|
||||
? "Read the full body from .data.issue.body; .data.json.body is intentionally omitted so large bodies are emitted only once."
|
||||
: null,
|
||||
...commentsCompatibility,
|
||||
readCommands: {
|
||||
...(includeBody ? {} : issueBodyReadCommands(repo, issueNumber)),
|
||||
|
||||
Reference in New Issue
Block a user