@bbearai/core 0.5.1 → 0.5.3

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/dist/index.js CHANGED
@@ -114,7 +114,7 @@ var ContextCaptureManager = class {
114
114
  if (this.navigationHistory.length > 0) {
115
115
  return this.navigationHistory[this.navigationHistory.length - 1];
116
116
  }
117
- if (typeof window !== "undefined") {
117
+ if (typeof window !== "undefined" && window.location) {
118
118
  return window.location.pathname;
119
119
  }
120
120
  return "unknown";
@@ -226,7 +226,7 @@ var ContextCaptureManager = class {
226
226
  };
227
227
  }
228
228
  captureNavigation() {
229
- if (typeof window === "undefined" || typeof history === "undefined") return;
229
+ if (typeof window === "undefined" || typeof history === "undefined" || !window.location) return;
230
230
  this.trackNavigation(window.location.pathname);
231
231
  const self = this;
232
232
  this.originalPushState = history.pushState;
@@ -661,8 +661,8 @@ var BugBearClient = class {
661
661
  return { success: false, error: rateLimit.error };
662
662
  }
663
663
  if (!userInfo) {
664
- console.error("BugBear: No user info available, cannot submit report");
665
- return { success: false, error: "User not authenticated" };
664
+ console.error("BugBear: No user info available, cannot submit report. Ensure your BugBear config provides a getCurrentUser() callback that returns { id, email }.");
665
+ return { success: false, error: "Unable to identify user. Check that your app passes a getCurrentUser callback to BugBear config." };
666
666
  }
667
667
  const testerInfo = await this.getTesterInfo();
668
668
  fullReport = {
@@ -768,10 +768,9 @@ var BugBearClient = class {
768
768
  platforms
769
769
  )
770
770
  `;
771
- const twentyFourHoursAgo = new Date(Date.now() - 24 * 60 * 60 * 1e3).toISOString();
772
771
  const [pendingResult, completedResult] = await Promise.all([
773
772
  this.supabase.from("test_assignments").select(selectFields).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["pending", "in_progress"]).order("created_at", { ascending: true }).range(from, to),
774
- this.supabase.from("test_assignments").select(selectFields).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["passed", "failed", "skipped", "blocked"]).gte("completed_at", twentyFourHoursAgo).order("completed_at", { ascending: false }).limit(50)
773
+ this.supabase.from("test_assignments").select(selectFields).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["passed", "failed", "skipped", "blocked"]).order("completed_at", { ascending: false }).limit(100)
775
774
  ]);
776
775
  if (pendingResult.error) {
777
776
  console.error("BugBear: Failed to fetch assignments", formatPgError(pendingResult.error));
package/dist/index.mjs CHANGED
@@ -80,7 +80,7 @@ var ContextCaptureManager = class {
80
80
  if (this.navigationHistory.length > 0) {
81
81
  return this.navigationHistory[this.navigationHistory.length - 1];
82
82
  }
83
- if (typeof window !== "undefined") {
83
+ if (typeof window !== "undefined" && window.location) {
84
84
  return window.location.pathname;
85
85
  }
86
86
  return "unknown";
@@ -192,7 +192,7 @@ var ContextCaptureManager = class {
192
192
  };
193
193
  }
194
194
  captureNavigation() {
195
- if (typeof window === "undefined" || typeof history === "undefined") return;
195
+ if (typeof window === "undefined" || typeof history === "undefined" || !window.location) return;
196
196
  this.trackNavigation(window.location.pathname);
197
197
  const self = this;
198
198
  this.originalPushState = history.pushState;
@@ -627,8 +627,8 @@ var BugBearClient = class {
627
627
  return { success: false, error: rateLimit.error };
628
628
  }
629
629
  if (!userInfo) {
630
- console.error("BugBear: No user info available, cannot submit report");
631
- return { success: false, error: "User not authenticated" };
630
+ console.error("BugBear: No user info available, cannot submit report. Ensure your BugBear config provides a getCurrentUser() callback that returns { id, email }.");
631
+ return { success: false, error: "Unable to identify user. Check that your app passes a getCurrentUser callback to BugBear config." };
632
632
  }
633
633
  const testerInfo = await this.getTesterInfo();
634
634
  fullReport = {
@@ -734,10 +734,9 @@ var BugBearClient = class {
734
734
  platforms
735
735
  )
736
736
  `;
737
- const twentyFourHoursAgo = new Date(Date.now() - 24 * 60 * 60 * 1e3).toISOString();
738
737
  const [pendingResult, completedResult] = await Promise.all([
739
738
  this.supabase.from("test_assignments").select(selectFields).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["pending", "in_progress"]).order("created_at", { ascending: true }).range(from, to),
740
- this.supabase.from("test_assignments").select(selectFields).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["passed", "failed", "skipped", "blocked"]).gte("completed_at", twentyFourHoursAgo).order("completed_at", { ascending: false }).limit(50)
739
+ this.supabase.from("test_assignments").select(selectFields).eq("project_id", this.config.projectId).eq("tester_id", testerInfo.id).in("status", ["passed", "failed", "skipped", "blocked"]).order("completed_at", { ascending: false }).limit(100)
741
740
  ]);
742
741
  if (pendingResult.error) {
743
742
  console.error("BugBear: Failed to fetch assignments", formatPgError(pendingResult.error));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbearai/core",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Core utilities and types for BugBear QA platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",