atlassian / atlassian/twg-cli

[Bug]: --select removes pageInfo, disabling truncation detection

Open
#12 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### TWG CLI version
1.2.6

### Operating system
Ubuntu 24.04 (WSL2)

### Command or agent request
Both run against a project with more than 100 matching issues:

```bash
twg jira workitem query --jql 'project = ABC' --limit 200 -o json
twg jira workitem query --jql 'project = ABC' --limit 200 --select data.issues.key -o json
```

### Expected behavior
`pageInfo` is not payload data: it is the signal that the result set was truncated. It should survive a `--select` projection, or its removal should be reported.

### Actual behavior
Without `--select`:

```
issues returned: 100
pageInfo: {'hasNextPage': True, 'nextCursor': ''}
```

With `--select data.issues.key`, same query and same limit:

```
issues returned: 100
pageInfo: absent
top-level keys: ['apiVersion', 'command', 'meta', 'data']
```

Exit code 0 in both cases.

A pagination loop that reads `hasNextPage` finds it absent and stops, so a full page is treated as a complete result set. `--select` is the flag recommended for reducing token usage in agent contexts, so this affects consumers following that guidance.

Workaround: name `pageInfo` in the projection (`--select data.issues.key,pageInfo`). A full page returned without `pageInfo` should be treated as an error rather than as the end of the set.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the `--select` projection handling for `twg jira workitem query`, then compare it with the pagination response used by the same command. Reproduce the two commands in the issue against a project with more than 100 matching issues. Done means truncation information is preserved or its removal is reported, so consumers do not mistake a full page for the complete result set.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.