comfy-pr 1.4.1 → 1.4.2

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": "comfy-pr",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Make PRs that publishes ComfyUI Custom Nodes to [ComfyUI Registry]( https://registry.comfy.org/ ).",
5
5
  "keywords": [],
6
6
  "license": "ISC",
package/src/CNRepos.ts CHANGED
@@ -94,6 +94,14 @@ CNRepos.createIndex(
94
94
  },
95
95
  ).catch(() => {});
96
96
 
97
+ // Index to support early $match before $unwind in baseCRPullStatusPipeline (analyzePullsStatus.ts)
98
+ // Uses comments.state (scalar Task field) to avoid "Cannot index parallel arrays" error —
99
+ // crPulls.data is already one array level, so comments.data (another array) would be invalid.
100
+ CNRepos.createIndex(
101
+ { "crPulls.data.comments.state": 1 },
102
+ { name: "idx_crpulls_comments_state", sparse: true, background: true },
103
+ ).catch(console.error);
104
+
97
105
  // Note: pulls.mtime index is created by setup-performance-indexes.ts script
98
106
  // Run: bun run db:setup-indexes
99
107
 
@@ -84,6 +84,9 @@ export function baseCRPullStatusPipeline(): Pipeline<
84
84
  > {
85
85
  return (
86
86
  $pipeline(CNRepos)
87
+ // Early filter: skip docs whose crPulls have no fetched comments — avoids full-scan before $unwind
88
+ // Uses comments.state (scalar) not comments.data (array) to avoid "Cannot index parallel arrays"
89
+ .match({ "crPulls.data": { $elemMatch: { "comments.state": "ok" } } })
87
90
  // get latest pr comments time
88
91
  .set({
89
92
  "crPulls.data.pull.latest_comment_at": {