Personal Telegram developer console for GitHub
fix: preserve issue pagination across mixed GitHub pages
davoodmehraban89 committed
Oct 3, 2026 at 09:35 UTC
946de827a794136e524dcbebb9d1ed7adf6bcf87
1 file changed
+22
-3
src/github.js
+22
-3
@@ -123,6 +123,17 @@ export class GitHubService {
123
};
124
}
125
126
+ mapIssue(issue = {}) {
127
+ return {
128
+ number: issue.number,
129
+ title: issue.title || '',
130
+ state: issue.state || '',
131
+ author: issue.user?.login || 'unknown',
132
+ comments: issue.comments ?? 0,
133
+ url: issue.html_url || ''
134
+ };
135
+ }
136
+
137
async listRepositories() {
138
const data = await this.requestJson(`${this.baseUrl}/user/repos?sort=updated&per_page=20&affiliation=owner,collaborator,organization_member`, 'GitHub repositories');
139
return data.map(r => { const repo = this.mapRepository(r); return { ...repo, title: `${repo.name} ${repo.private ? '🔒' : '🌐'}` }; });
@@ -273,9 +284,17 @@ export class GitHubService {
284
async listIssues(repoRef, { perPage = 10, page = 1 } = {}) {
285
const count = clampPerPage(perPage, 10); const pageNumber = clampPage(page); const { apiBase } = await this.getRepositoryContext(repoRef);
286
const data = await this.requestJson(`${apiBase}/issues?state=all&per_page=${count}&page=${pageNumber}`, 'GitHub issues');
276
- return data.filter(issue => !issue.pull_request).map(issue => ({
277
- number: issue.number, title: issue.title || '', state: issue.state || '', author: issue.user?.login || 'unknown', comments: issue.comments ?? 0, url: issue.html_url || ''
278
- }));
287
+ return data.filter(issue => !issue.pull_request).map(issue => this.mapIssue(issue));
288
+ }
289
+
290
+ async listIssuesPage(repoRef, { page = 1 } = {}) {
291
+ const pageNumber = clampPage(page);
292
+ const { apiBase } = await this.getRepositoryContext(repoRef);
293
+ const data = await this.requestJson(`${apiBase}/issues?state=all&per_page=20&page=${pageNumber}`, 'GitHub issues');
294
+ return {
295
+ items: data.filter(issue => !issue.pull_request).map(issue => this.mapIssue(issue)),
296
+ hasMore: data.length === 20
297
+ };
298
}
299
300
async listReleases(repoRef, { perPage = 10, page = 1 } = {}) {