@terreno/comms 58.0.2 → 58.0.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/CHANGELOG.md CHANGED
@@ -20,6 +20,31 @@ Upgrade notes for consumer action live in [`mcp-server/src/docs/upgrades/`](mcp-
20
20
 
21
21
  Unreleased changes live in [`changelog/unreleased/`](changelog/unreleased/). Add one Markdown file per feature (see that directory's README) instead of editing this section.
22
22
 
23
+ ## [58.0.3] - 2026-11-11
24
+
25
+ Upgrade note: [`mcp-server/src/docs/upgrades/58.0.3.md`](mcp-server/src/docs/upgrades/58.0.3.md).
26
+
27
+ ### Added
28
+
29
+ - `fix-code-scanning-alerts` skill: clears every open CodeQL alert on one PR. Fixes close on the master rescan; reviewed false positives go in `.github/code-scanning/dismissals.json` and a workflow dismisses them after merge. CodeQL now also scans pull requests and ignores test files. See `docs/how-to/fix-code-scanning-alerts.md`.
30
+ - **@terreno/syncdb:** `registerTerrenoDevClientDispatch`, `registerTerrenoDevStorage`, and `registerTerrenoDevCommand` for `terreno-mcp-local` dev tooling.
31
+ - **@terreno/mcp-server:** `read_logs` sources `network` and `native`; `dispatch_client_action`, storage read/write, and dev command list/invoke; CDP network capture with header redaction.
32
+
33
+ ### Changed
34
+
35
+ - Package tests run as concurrent `bun test --shard` processes through `scripts/test-shards.ts` (half the cores by default, `TERRENO_TEST_SHARDS` to override), and `test:coverage` merges the shards' LCOV. CircleCI now pins Bun 1.4.4, the same version as the local toolchain.
36
+
37
+ ### Fixed
38
+
39
+ - `Avatar` no longer freezes release builds when its image fails to load. The image error handler passed the native error event to `console.warn`, and with Sentry enabled the app hung while turning that event into a breadcrumb. It now logs only the error message.
40
+ - Mongo filters built from request values reject non-string input with 400 instead of running it as a query operator: AI request explorer `model`, observability review `status`, review batch `promptName`, experiment `datasetId`, trace list filters, push-token `platform`, and `loadDocOr404` ids (404). Sync conflict reloads and tombstone lookups match `_id` with `$eq`.
41
+ - Nested-path helpers in `populate`, RBAC field views, and MCP `excludeFields` skip `__proto__`, `constructor`, and `prototype`, so a crafted path can no longer touch `Object.prototype`.
42
+ - Removed polynomial-time regexes from bearer-header parsing, trailing-slash trimming (syncdb, ui `ListDetailLayout`, jobs Cloud Tasks runner, admin route paths), prompt references, judge score ranges, AI JSON fence stripping, and the MCP import parser.
43
+ - Dataset schema validation stops at the first error (`allErrors` off) to bound work on untrusted input.
44
+ - `isTestUser` in `@terreno/ui` matches `nang.io` and `example.com` as the email domain or a subdomain, not as a substring, and always returns a boolean.
45
+ - MCP OAuth metadata responses set an explicit JSON content type.
46
+ - The example app's AI session id comes from `expo-crypto` `randomUUID` instead of `Math.random`.
47
+
23
48
  ## [58.0.2] - 2026-11-09
24
49
 
25
50
  ### Fixed
@@ -141,8 +141,13 @@ const addPushTokenRoutes = (app, options) => {
141
141
  if (req.query.active === "true" || req.query.active === "false") {
142
142
  match.active = req.query.active === "true";
143
143
  }
144
- if (req.query.platform) {
145
- match.platform = req.query.platform;
144
+ const platform = req.query.platform;
145
+ if (platform !== undefined && platform !== "") {
146
+ // A query-string object such as `platform[$ne]=ios` would become a Mongo operator.
147
+ if (typeof platform !== "string") {
148
+ throw new api_1.APIError({ status: 400, title: "platform must be a string" });
149
+ }
150
+ match.platform = { $eq: platform };
146
151
  }
147
152
  const [tokens, total] = await Promise.all([
148
153
  pushToken_1.PushToken.find(match).sort("-lastSeenAt").skip(skip).limit(limit),
package/package.json CHANGED
@@ -4,14 +4,14 @@
4
4
  "url": "https://github.com/TerrenoLabs/terreno/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@terreno/api": "58.0.2",
7
+ "@terreno/api": "58.0.3",
8
8
  "libphonenumber-js": "^1.13.8",
9
9
  "luxon": "^3.7.2"
10
10
  },
11
11
  "description": "Pluggable mail, SMS, push, and verification providers — part of Terreno, the batteries-included TypeScript framework for universal apps.",
12
12
  "devDependencies": {
13
13
  "@biomejs/biome": "2.5.13",
14
- "@terreno/test": "58.0.2",
14
+ "@terreno/test": "58.0.3",
15
15
  "@types/bun": "^1.4.0",
16
16
  "@types/express": "^5.0.6",
17
17
  "@types/luxon": "^3.7.1",
@@ -84,12 +84,12 @@
84
84
  "lint": "biome check ./src ./e2e",
85
85
  "lint:fix": "biome check --write ./src ./e2e",
86
86
  "smoke": "bun e2e/smoke.ts",
87
- "test": "bun test",
88
- "test:agent": "AGENT=1 bun test --only-failures",
89
- "test:ci": "bun test",
87
+ "test": "bun ../scripts/test-shards.ts",
88
+ "test:agent": "AGENT=1 bun ../scripts/test-shards.ts -- --only-failures",
89
+ "test:ci": "bun ../scripts/test-shards.ts",
90
90
  "test:coverage": "bun run ../scripts/check-coverage.ts",
91
91
  "typecheck": "tsc -p tsconfig.typecheck.json"
92
92
  },
93
93
  "types": "dist/index.d.ts",
94
- "version": "58.0.2"
94
+ "version": "58.0.3"
95
95
  }
@@ -343,6 +343,10 @@ describe("CommsApp", () => {
343
343
  [["ExponentPushToken[ios]", false]]
344
344
  );
345
345
  assert.equal(ignoredFilter.body.total, 2);
346
+
347
+ // Operator-shaped query values are rejected instead of reaching Mongo.
348
+ await owner.get("/comms/pushTokens?platform[$ne]=ios").expect(400);
349
+ await owner.get("/comms/pushTokens?platform=ios&platform=android").expect(400);
346
350
  });
347
351
 
348
352
  it("surfaces non-conflict storage failures while claiming a push token", async (): Promise<void> => {
@@ -209,8 +209,13 @@ export const addPushTokenRoutes = (
209
209
  if (req.query.active === "true" || req.query.active === "false") {
210
210
  match.active = req.query.active === "true";
211
211
  }
212
- if (req.query.platform) {
213
- match.platform = req.query.platform;
212
+ const platform = req.query.platform;
213
+ if (platform !== undefined && platform !== "") {
214
+ // A query-string object such as `platform[$ne]=ios` would become a Mongo operator.
215
+ if (typeof platform !== "string") {
216
+ throw new APIError({status: 400, title: "platform must be a string"});
217
+ }
218
+ match.platform = {$eq: platform};
214
219
  }
215
220
  const [tokens, total] = await Promise.all([
216
221
  PushToken.find(match).sort("-lastSeenAt").skip(skip).limit(limit),