Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codelit-platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"name": "SendLit",
"slug": "sendlit"
},
"cliVersion": "0.4.1",
"cliVersion": "0.4.2",
"capabilities": [
"auth",
"mcp",
"observability",
"billing"
],
"managedFiles": {
".github/workflows/platform-conformance.yml": "7e1a5fa61c16447cc645aee556a101b62b70346322ff7706095df94e6fe7cbd1"
".github/workflows/platform-conformance.yml": "939bf5686a4433b93153ca2b919ba77251c7bf70b17b269cde02606be41535f4"
},
"productOwnedGlobs": [
"apps/**",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: ${{ !hashFiles('bun.lock') }}
- run: bun install --frozen-lockfile
# Pinned to the CLI release that wrote this file. `sync` moves it.
- run: bunx @codelitdev/platform-cli@0.4.1 doctor
- run: bunx @codelitdev/platform-cli@0.4.2 doctor
- run: bun run --filter "*/api" check:drift
# Fails when the API package has no `test:conformance` script.
- run: bun run --filter "*/api" test:conformance
12 changes: 6 additions & 6 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"@anthropic-ai/sdk": "^0.135.0",
"@better-auth/cimd": "1.7.7",
"@better-auth/oauth-provider": "1.7.7",
"@codelitdev/billing": "0.4.1",
"@codelitdev/mcp-server-kit": "0.4.1",
"@codelitdev/oauth-server-kit": "0.4.1",
"@codelitdev/observability": "0.4.1",
"@codelitdev/platform": "0.4.1",
"@codelitdev/billing": "0.4.2",
"@codelitdev/mcp-server-kit": "0.4.2",
"@codelitdev/oauth-server-kit": "0.4.2",
"@codelitdev/observability": "0.4.2",
"@codelitdev/platform": "0.4.2",
"@modelcontextprotocol/node": "^2.0.0",
"@modelcontextprotocol/server": "^2.0.0",
"@sendlit/api-contract": "workspace:*",
Expand Down Expand Up @@ -64,7 +64,7 @@
},
"devDependencies": {
"@better-auth/core": "1.7.7",
"@codelitdev/platform-conformance": "0.4.1",
"@codelitdev/platform-conformance": "0.4.2",
"@electric-sql/pglite": "0.5.8",
"@modelcontextprotocol/client": "^2.0.0",
"@sendlit/test-utils": "workspace:*",
Expand Down
21 changes: 21 additions & 0 deletions apps/api/src/observability/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ describe("SendLit observability", () => {
expect(properties.email).toBeUndefined();
});

it("sends id properties as they are instead of masking them as tokens", () => {
const client = fakeClient();
const events = createSendLitObservability(env, { client, purpose: "events" });
const teamId = "01a15ed4-d3f2-798f-b6fa-cbedeb854b54";

events.captureEvent({
event: "team_paused_for_review",
source: "abuse.flags",
subjectId: teamId,
properties: {
team_id: teamId,
organization_id: teamId,
reason: "content_review",
},
});

const [{ properties }] = client.capture.mock.calls[0];
expect(properties.team_id).toBe(teamId);
expect(properties.organization_id).toBe(teamId);
});

it("dedupes identical errors within the TTL window", () => {
const client = fakeClient();
const observability = createSendLitObservability(env, { client });
Expand Down
21 changes: 20 additions & 1 deletion apps/api/src/observability/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ const PROPERTY_ALLOWLIST = new Set([
"scan_mode",
]);

/** Allowlisted keys that hold opaque record ids. They skip the package's
* long-token mask, which would otherwise hide every UUID. */
const IDENTIFIER_KEYS = new Set([
"team_id",
"user_id",
"contact_id",
"sequence_id",
"ongoing_sequence_id",
"template_id",
"segment_id",
"email_id",
"job_id",
"organization_id",
"form_id",
]);

/**
* `purpose: "events"` builds the instance for product analytics. The package
* dedupes and rate-caps captures per source, which suits errors but would drop
Expand Down Expand Up @@ -94,7 +110,10 @@ export function createSendLitObservability(
}
: {}),
},
contextPolicy: { propertyAllowlist: PROPERTY_ALLOWLIST },
contextPolicy: {
propertyAllowlist: PROPERTY_ALLOWLIST,
identifierKeys: IDENTIFIER_KEYS,
},
...(forEvents
? { dedupeTtlMs: 0, dedupeMaxKeys: 1, perSourceCap: Number.POSITIVE_INFINITY }
: {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"postinstall": "fumadocs-mdx"
},
"dependencies": {
"@codelitdev/design-system": "0.4.1",
"@codelitdev/design-system": "0.4.2",
"@sendlit/api-contract": "workspace:*",
"@sendlit/email-blocks": "workspace:*",
"@sendlit/email-editor": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@codelitdev/design-system": "0.4.1",
"@codelitdev/observability": "0.4.1",
"@codelitdev/design-system": "0.4.2",
"@codelitdev/observability": "0.4.2",
"@radix-ui/react-alert-dialog": "^1.1.18",
"@radix-ui/react-dialog": "^1.1.18",
"@radix-ui/react-label": "^2.1.11",
Expand Down
32 changes: 16 additions & 16 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading