Skip to content

[ENHANCEMENT] Return partial results from fetchIssueRelationships on mid-batch failure #25

@c-vigo

Description

@c-vigo

Context

Copilot review on PR #22 (comment) identified that fetchIssueRelationships discards all successfully fetched relationships when a mid-batch error occurs.

The try/catch wraps the entire batch loop, so if batch N fails, results from batches 1..N-1 are thrown away and an empty Map is returned.

Implementation Plan

  • Move try/catch from around the entire for loop to inside the loop body in src/index.ts (fetchIssueRelationships, lines ~415-460)
  • On "doesn't exist on type" error: break out of the loop (the sub-issues API is unavailable — no point continuing)
  • On other errors (transient/network): core.warning per-batch, then continue to the next batch
  • Return the accumulated relationships map (partial results) instead of new Map()
  • Update tests in src/__tests__/unit/index.test.ts: add a multi-batch test where batch 1 succeeds and batch 2 fails, and assert that partial results from batch 1 are returned
  • Rebuild dist via npm run package

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions