@checkstack/notification-backend 0.1.19 → 0.1.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @checkstack/notification-backend
2
2
 
3
+ ## 0.1.21
4
+
5
+ ### Patch Changes
6
+
7
+ - d1a2796: Enforce stricter code quality standards and eliminate AI slop anti-patterns.
8
+
9
+ **New utility**
10
+
11
+ - `extractErrorMessage(error, fallback?)` in `@checkstack/common` for consistent error extraction
12
+
13
+ **ESLint rules**
14
+
15
+ - `react-hooks/rules-of-hooks` and `exhaustive-deps` for hook correctness
16
+ - `no-console` in frontend packages — forces `toast` over silent `console.error`
17
+ - `no-restricted-syntax` banning `instanceof Error` — forces `extractErrorMessage`
18
+ - Custom `no-eslint-disable-any` rule preventing `@typescript-eslint/no-explicit-any` circumvention
19
+
20
+ **Refactoring**
21
+
22
+ - Replace 141 `instanceof Error` boilerplate patterns across the codebase
23
+ - Replace swallowed `console.error` with user-visible `toast.error()` feedback
24
+ - Remove 15 redundant `as` type casts in IntegrationsPage and ProviderConnectionsPage
25
+ - Consolidate 3 identical callback handlers into `handleDialogClose`
26
+ - Fix conditional React hook call in `FormField.tsx`
27
+ - Fix unstable useMemo deps in `Dashboard.tsx`
28
+ - Replace `useEffect`→`setState` with derived `useMemo` in `RegisterPage.tsx`
29
+ - Rewrite `keystore.test.ts` with typed `DrizzleMockChain` (eliminating 7 `any` suppressions)
30
+ - Delete obvious comments in `encryption.ts` and Teams `provider.ts`
31
+
32
+ - Updated dependencies [d1a2796]
33
+ - @checkstack/common@0.6.5
34
+ - @checkstack/backend-api@0.11.1
35
+ - @checkstack/auth-backend@0.4.17
36
+ - @checkstack/auth-common@0.6.1
37
+ - @checkstack/notification-common@0.2.8
38
+ - @checkstack/signal-common@0.1.9
39
+ - @checkstack/queue-api@0.2.12
40
+
41
+ ## 0.1.20
42
+
43
+ ### Patch Changes
44
+
45
+ - Updated dependencies [54a5f80]
46
+ - @checkstack/backend-api@0.11.0
47
+ - @checkstack/auth-backend@0.4.16
48
+ - @checkstack/queue-api@0.2.11
49
+
3
50
  ## 0.1.19
4
51
 
5
52
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/notification-backend",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@checkstack/notification-common": "0.2.7",
18
- "@checkstack/backend-api": "0.10.0",
18
+ "@checkstack/backend-api": "0.11.0",
19
19
  "@checkstack/signal-common": "0.1.8",
20
- "@checkstack/queue-api": "0.2.9",
21
- "@checkstack/auth-backend": "0.4.14",
20
+ "@checkstack/queue-api": "0.2.11",
21
+ "@checkstack/auth-backend": "0.4.16",
22
22
  "@checkstack/auth-common": "0.6.0",
23
23
  "drizzle-orm": "^0.45.0",
24
24
  "zod": "^4.2.1",
@@ -28,8 +28,8 @@
28
28
  "devDependencies": {
29
29
  "@checkstack/drizzle-helper": "0.0.4",
30
30
  "@checkstack/scripts": "0.1.2",
31
- "@checkstack/tsconfig": "0.0.4",
32
- "@checkstack/test-utils-backend": "0.1.15",
31
+ "@checkstack/tsconfig": "0.0.5",
32
+ "@checkstack/test-utils-backend": "0.1.17",
33
33
  "@types/node": "^20.0.0",
34
34
  "typescript": "^5.0.0"
35
35
  }
package/src/router.ts CHANGED
@@ -39,6 +39,7 @@ import {
39
39
  createStrategyService,
40
40
  type StrategyService,
41
41
  } from "./strategy-service";
42
+ import { extractErrorMessage } from "@checkstack/common";
42
43
 
43
44
  /**
44
45
  * Helper: Resolve user contact information based on strategy's contactResolution type.
@@ -345,10 +346,8 @@ export const createNotificationRouter = (
345
346
  await subscribeToGroup(database, userId, input.groupId);
346
347
  } catch (error) {
347
348
  // Convert group-not-found errors to proper ORPC errors
348
- if (
349
- error instanceof Error &&
350
- error.message.includes("does not exist")
351
- ) {
349
+ const message = extractErrorMessage(error);
350
+ if (message.includes("does not exist")) {
352
351
  throw new ORPCError("NOT_FOUND", {
353
352
  message: `Notification group '${input.groupId}' does not exist. It may not have been created yet.`,
354
353
  });
@@ -680,7 +679,7 @@ export const createNotificationRouter = (
680
679
  results.push({
681
680
  strategyId: strategy.qualifiedId,
682
681
  success: false,
683
- error: error instanceof Error ? error.message : "Unknown error",
682
+ error: extractErrorMessage(error, "Unknown error"),
684
683
  });
685
684
  }
686
685
  }
@@ -1077,9 +1076,7 @@ export const createNotificationRouter = (
1077
1076
  return {
1078
1077
  success: false,
1079
1078
  error:
1080
- error instanceof Error
1081
- ? error.message
1082
- : "Failed to send test notification",
1079
+ extractErrorMessage(error, "Failed to send test notification"),
1083
1080
  };
1084
1081
  }
1085
1082
  }