Skip to content

fix(analytics): ensure workspace mac inserts select all columns - #1557

Merged
realcodesiman merged 2 commits into
mainfrom
realcodesiman/debug-mac
Oct 26, 2026
Merged

realcodesiman merged 2 commits into
mainfrom
realcodesiman/debug-mac

Conversation

@realcodesiman

@realcodesiman realcodesiman commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix WorkspaceMac insert-select statements so selected fields match the table's required column order and types.
  • Prevent malformed SQL from bypassing the repository's MAC counter initialization path.

Changes

  • packages/analytics/src/repositories/postgres/mac.repository.ts: select generated identity, timestamps, and typed period values.
  • packages/analytics/__tests__/mac.repository.sql.test.ts: add a mock-client SQL-shape regression test.
  • packages/analytics/package.json and pnpm-lock.yaml: add Drizzle's mock-client dependency for the test.

Test plan

  • pnpm ultracite fix (pre-commit hook)
  • workspace check-types (pre-commit hook)
  • pnpm --filter @chatbotx.io/analytics test -- mac.repository.sql.test.ts

@github-actions github-actions Bot added the bug Something isn't working as expected label Oct 26, 2026
@realcodesiman
realcodesiman merged commit 00d8b48 into main Oct 26, 2026
4 checks passed
@realcodesiman
realcodesiman deleted the realcodesiman/debug-mac branch October 26, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant