buddy-workbench 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buddy-workbench",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -345,7 +345,7 @@ async function searchJiraWithFallbacksPaginated(jiraHost, headers, jqlCandidates
345
345
  startAt += page.length;
346
346
  if (page.length === 0) break;
347
347
  } while (startAt < total);
348
- return issues;
348
+ if (issues.length > 0) return issues;
349
349
  } catch {
350
350
  // Try the next JQL form when this Jira instance does not support the current one.
351
351
  }
@@ -418,6 +418,7 @@ router.get('/recently-commented', async (_req, res) => {
418
418
  // This function targets issues where the current user authored a comment. The
419
419
  // text search fallbacks below can miss comments that do not mention the author.
420
420
  jqlCandidates.push('commentedBy(currentUser()) ORDER BY updated DESC');
421
+ jqlCandidates.push('(assignee = currentUser() OR reporter = currentUser() OR watcher = currentUser()) AND updated >= -60d ORDER BY updated DESC');
421
422
  if (identity.name) {
422
423
  jqlCandidates.push(`comment ~ "\\"${identity.name}\\"" ORDER BY updated DESC`);
423
424
  jqlCandidates.push(`comment ~ "${identity.name}" ORDER BY updated DESC`);
@@ -428,16 +429,17 @@ router.get('/recently-commented', async (_req, res) => {
428
429
  if (identity.accountId) {
429
430
  jqlCandidates.push(`comment ~ "${identity.accountId}" ORDER BY updated DESC`);
430
431
  }
431
- jqlCandidates.push('(assignee = currentUser() OR reporter = currentUser() OR watcher = currentUser()) AND updated >= -60d ORDER BY updated DESC');
432
- jqlCandidates.push('updated >= -60d ORDER BY updated DESC');
433
-
434
- const issues = await searchJiraWithFallbacksPaginated(jiraHost, headers, jqlCandidates, 'summary,priority,status,updated,assignee,reporter');
432
+
433
+ const issues = await searchJiraWithFallbacksPaginated(jiraHost, headers, jqlCandidates, 'summary,priority,status,updated,assignee,reporter,comment');
435
434
  const results = [];
436
435
 
437
- const issueComments = await mapInBatches(issues, 5, async (issue) => {
436
+ const issueComments = await mapInBatches(issues, 10, async (issue) => {
438
437
  const key = issue.key;
439
438
  const fields = issue.fields || {};
440
- const comments = await fetchCommentsForIssue(jiraHost, headers, key, 50);
439
+ let comments = fields.comment?.comments;
440
+ if (!Array.isArray(comments) || Number(fields.comment?.total) > comments.length) {
441
+ comments = await fetchCommentsForIssue(jiraHost, headers, key, 50);
442
+ }
441
443
 
442
444
  const myComments = comments.filter((c) => isAuthorMatch(c.author || c.updateAuthor, identity));
443
445
  if (myComments.length > 0) {