@bbearai/core 0.9.5 → 0.9.6

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
@@ -1200,12 +1200,12 @@ var BugBearClient = class {
1200
1200
  return { success: true };
1201
1201
  });
1202
1202
  this._queue.registerHandler("message", async (payload) => {
1203
- const { error } = await this.supabase.from("discussion_messages").insert(payload);
1203
+ const { error } = await this.supabase.from("discussion_messages").insert(payload).select("id").single();
1204
1204
  if (error) return { success: false, error: error.message };
1205
1205
  return { success: true };
1206
1206
  });
1207
1207
  this._queue.registerHandler("feedback", async (payload) => {
1208
- const { error } = await this.supabase.from("test_feedback").insert(payload);
1208
+ const { error } = await this.supabase.from("test_feedback").insert(payload).select("id").single();
1209
1209
  if (error) return { success: false, error: error.message };
1210
1210
  return { success: true };
1211
1211
  });
@@ -1229,6 +1229,8 @@ var BugBearClient = class {
1229
1229
  subscribeToChanges(callbacks) {
1230
1230
  this.unsubscribeAll();
1231
1231
  const projectId = this.config.projectId;
1232
+ if (!projectId) return () => {
1233
+ };
1232
1234
  const debounce = (fn, ms = 500) => {
1233
1235
  let timer;
1234
1236
  return () => {
@@ -1352,7 +1354,7 @@ var BugBearClient = class {
1352
1354
  return { success: false, error: validationError };
1353
1355
  }
1354
1356
  const userInfo = await this.getCurrentUserInfo();
1355
- const rateLimitId = userInfo?.email || this.config.projectId;
1357
+ const rateLimitId = userInfo?.email || this.config.projectId || "unknown";
1356
1358
  const rateLimit = await this.checkRateLimit(rateLimitId, "report_submit");
1357
1359
  if (!rateLimit.allowed) {
1358
1360
  return { success: false, error: rateLimit.error };
package/dist/index.mjs CHANGED
@@ -1154,12 +1154,12 @@ var BugBearClient = class {
1154
1154
  return { success: true };
1155
1155
  });
1156
1156
  this._queue.registerHandler("message", async (payload) => {
1157
- const { error } = await this.supabase.from("discussion_messages").insert(payload);
1157
+ const { error } = await this.supabase.from("discussion_messages").insert(payload).select("id").single();
1158
1158
  if (error) return { success: false, error: error.message };
1159
1159
  return { success: true };
1160
1160
  });
1161
1161
  this._queue.registerHandler("feedback", async (payload) => {
1162
- const { error } = await this.supabase.from("test_feedback").insert(payload);
1162
+ const { error } = await this.supabase.from("test_feedback").insert(payload).select("id").single();
1163
1163
  if (error) return { success: false, error: error.message };
1164
1164
  return { success: true };
1165
1165
  });
@@ -1183,6 +1183,8 @@ var BugBearClient = class {
1183
1183
  subscribeToChanges(callbacks) {
1184
1184
  this.unsubscribeAll();
1185
1185
  const projectId = this.config.projectId;
1186
+ if (!projectId) return () => {
1187
+ };
1186
1188
  const debounce = (fn, ms = 500) => {
1187
1189
  let timer;
1188
1190
  return () => {
@@ -1306,7 +1308,7 @@ var BugBearClient = class {
1306
1308
  return { success: false, error: validationError };
1307
1309
  }
1308
1310
  const userInfo = await this.getCurrentUserInfo();
1309
- const rateLimitId = userInfo?.email || this.config.projectId;
1311
+ const rateLimitId = userInfo?.email || this.config.projectId || "unknown";
1310
1312
  const rateLimit = await this.checkRateLimit(rateLimitId, "report_submit");
1311
1313
  if (!rateLimit.allowed) {
1312
1314
  return { success: false, error: rateLimit.error };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbearai/core",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "Core utilities and types for BugBear QA platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",