Conversation
Signed-off-by: Pierre 'McFly' Marty <pmarty@linagora.com>
Signed-off-by: Pierre 'McFly' Marty <pmarty@linagora.com>
Signed-off-by: Pierre 'McFly' Marty <pmarty@linagora.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 13 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughEnabled high-level walkthrough summaries and automated labeling in CodeRabbit config; added labeling instructions and code-guideline ingestion patterns. Standardized test scripts to use Changes
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected -t check -- --max-diagnostics none |
❌ Failed | 18s | View ↗ |
nx affected -t test |
✅ Succeeded | 2s | View ↗ |
nx affected -t build |
✅ Succeeded | 1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-03-27 16:20:08 UTC
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f308ae7b-3dc8-43c8-8138-cd4864853055
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
.coderabbit.yamlpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.jsonpackages/tom-server/package.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test / Test Affected Packages
- GitHub Check: Docs / Update Documentation
🧰 Additional context used
📓 Path-based instructions (3)
packages/*/package.json
📄 CodeRabbit inference engine (packages/AGENTS.md)
packages/*/package.json: Each package must have its ownpackage.json,tsconfig.json,rollup.config.js, andsrc/directory
Each package uses the@twake/*workspace protocol for inter-package dependenciesInternal packages must reference each other using npm workspace protocol with format
@twake/<name>: "*"
Files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
**/*.{ts,tsx,js,jsx,json,md}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
npm run format:checkandnpm run format:fixfor code formatting checks
Files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
**/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESM modules with
"type": "module"in package.json for npm workspaces + Lerna monorepo
**/package.json: Always runnpm installafter modifying anypackage.json
Use ES modules ("type": "module"configuration) in all packages
Files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
🧠 Learnings (29)
📓 Common learnings
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T09:08:46.887Z
Learning: Root-level configuration files should be edited with care as changes affect all packages in the monorepo
📚 Learning: 2026-03-18T21:43:54.137Z
Learnt from: pm-McFly
Repo: linagora/ToM-server PR: 341
File: packages/logger/package.json:38-39
Timestamp: 2026-03-18T21:43:54.137Z
Learning: In `packages/logger/package.json`, the `test` script intentionally runs plain `jest` without `LOG_TRANSPORTS=File LOG_FILE=/dev/null`. Adding those env vars causes the logger package's tests to fail, because those tests exercise the logger's own transport behavior and rely on actual log output. Do not suggest adding log-suppression env vars to this package's test script.
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to **/tests/**/*.{ts,js} : Tests run with `LOG_TRANSPORTS=File LOG_FILE=/dev/null jest` to suppress log output
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:23:13.313Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/tom-server/AGENTS.md:0-0
Timestamp: 2026-03-17T11:23:13.313Z
Learning: Applies to packages/tom-server/**/*.{test,spec}.{ts,tsx} : Tests must use SQLite in-memory database and mock external services (SMTP, Matrix homeserver) rather than using real services
Applied to files:
packages/tom-server/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to **/jest.config.{ts,js} : Tests use Jest + ts-jest and `testcontainers` for spinning up real PostgreSQL/LDAP in CI
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:20:10.724Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/common-settings-bridge/src/AGENTS.md:0-0
Timestamp: 2026-03-17T11:20:10.724Z
Learning: Applies to packages/common-settings-bridge/src/src/common-settings-bridge/**/*.test.ts : Use Jest for testing TypeScript code in the bridge module
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:24:48.682Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/tom-server/src/wellKnown/AGENTS.md:0-0
Timestamp: 2026-03-17T11:24:48.682Z
Learning: Applies to packages/tom-server/src/wellKnown/wellKnown/**/*.ts : When adding new config fields to well-known responses, update `src/config.json` (in tom-server) first, then include the value in the response object in the wellKnown directory
Applied to files:
packages/tom-server/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to **/tests/**/*.{ts,js} : Jest config maps `twake/*` imports to local `packages/*/src` directories, so tests run against source directly without building
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:20:10.724Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/common-settings-bridge/src/AGENTS.md:0-0
Timestamp: 2026-03-17T11:20:10.724Z
Learning: Applies to packages/common-settings-bridge/src/src/common-settings-bridge/**/*.test.ts : Mock the `matrix-appservice-bridge` library in Jest tests using the mock in `__mocks__/matrix-appservice-bridge.ts`
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to packages/tom-server/src/**/tests/**/*.{ts,js} : Feature API tests live in `tests/` directories within feature modules
Applied to files:
packages/tom-server/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to packages/*/jest.config.ts : Each package has its own `jest.config.ts` extending `jest-base.config.js` at the root
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.json
📚 Learning: 2026-03-23T09:08:46.887Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-23T09:08:46.887Z
Learning: Tests require built packages: run `npm build` first if running tests on fresh checkout
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to **/tests/**/*.{ts,js} : Run all tests using `npm run test`, or for single packages use `cd packages/<package> && npm run test`
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to **/rollup.config.{js,ts} : Build packages with Rollup
Applied to files:
packages/tom-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Build all packages using `npm run build`
Applied to files:
packages/tom-server/package.jsonpackages/federated-identity-service/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:21:03.013Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/federated-identity-service/AGENTS.md:0-0
Timestamp: 2026-03-17T11:21:03.013Z
Learning: Run tests using npx nx run twake/federated-identity-service:test
Applied to files:
packages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:21:09.401Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/federated-identity-service/src/AGENTS.md:0-0
Timestamp: 2026-03-17T11:21:09.401Z
Learning: Applies to packages/federated-identity-service/src/src/__testData__/ssl/** : Do not modify SSL certificates in `__testData__/ssl/` — they are pre-generated for local development
Applied to files:
packages/federated-identity-service/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to **/tests/**/*.{ts,js} : Run tests matching a pattern from within a package directory using `npx jest --testPathPattern="<pattern>"`
Applied to files:
packages/federated-identity-service/package.jsonpackages/matrix-identity-server/package.jsonpackages/matrix-resolve/package.json
📚 Learning: 2026-03-23T09:08:39.061Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-23T09:08:39.061Z
Learning: Applies to packages/matrix-identity-server/src/db/**/*.{ts,js} : `MatrixIdentityServer` initializes two databases: `IdentityServerDb` (identity-server tables) and `UserDB` (user directory)
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:21:27.917Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-identity-server/AGENTS.md:0-0
Timestamp: 2026-03-17T11:21:27.917Z
Learning: Applies to packages/matrix-identity-server/src/{account,3pid,lookup,terms,validate,keyManagement}/**/*.ts : All spec endpoints should be mounted at /_matrix/identity/v2/
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:22:24.131Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-identity-server/src/matrixDb/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:24.131Z
Learning: Applies to packages/matrix-identity-server/src/matrixDb/matrixDb/sql/**/*.ts : Keep Synapse DB schema queries minimal and schema-version-aware to accommodate changes between Synapse versions
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:22:45.233Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-identity-server/src/utils/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:45.233Z
Learning: Applies to packages/matrix-identity-server/src/utils/**/utils/mailer.ts : SMTP configuration in `mailer.ts` should use keys: `smtp_server`, `smtp_port`, `smtp_user`, `smtp_password`, `smtp_tls`
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:21:27.917Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-identity-server/AGENTS.md:0-0
Timestamp: 2026-03-17T11:21:27.917Z
Learning: Applies to packages/matrix-identity-server/src/validate/**/*.ts : Email sending requires SMTP config keys: smtp_server, smtp_port, smtp_user, smtp_password
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:22:12.102Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-identity-server/src/keyManagement/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:12.102Z
Learning: Applies to packages/matrix-identity-server/src/keyManagement/keyManagement/**/*.ts : Use Ed25519 for public key management in the Matrix Identity Server
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:23:51.582Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/tom-server/src/identity-server/AGENTS.md:0-0
Timestamp: 2026-03-17T11:23:51.582Z
Learning: Run identity-server tests using the command: npx nx run twake/tom-server:test -- --testPathPattern=identity-server
Applied to files:
packages/matrix-identity-server/package.json
📚 Learning: 2026-03-17T11:22:57.617Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-resolve/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:57.617Z
Learning: Applies to packages/matrix-resolve/src/**/*.ts : Implement `matrixResolve()` as a simple stateless API without caching for resolving Matrix homeserver addresses
Applied to files:
packages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:22:57.617Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-resolve/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:57.617Z
Learning: Applies to packages/matrix-resolve/**/*.test.ts : Mock `node-fetch` and DNS in tests — no network calls required for test execution
Applied to files:
packages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:22:57.617Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-resolve/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:57.617Z
Learning: Applies to packages/matrix-resolve/src/index.ts : Export `matrixResolve()`, `MatrixResolve` class, `WellKnownMatrixServer` type, `MatrixResolveArgs`, and `CacheType` from `src/index.ts`
Applied to files:
packages/matrix-resolve/package.json
📚 Learning: 2026-03-17T11:22:57.617Z
Learnt from: CR
Repo: linagora/ToM-server PR: 0
File: packages/matrix-resolve/AGENTS.md:0-0
Timestamp: 2026-03-17T11:22:57.617Z
Learning: Applies to packages/matrix-resolve/src/**/*.ts : Implement `MatrixResolve` class to support optional `toad-cache` LRU caching with configurable TTL and size parameters
Applied to files:
packages/matrix-resolve/package.json
🔇 Additional comments (5)
packages/tom-server/package.json (1)
39-39: Solid change: portability improved without changing test intent.Line 39 keeps the exact logging-suppression behavior and makes the script Windows-safe. Clean upgrade.
Based on learnings: Applies to /tests//*.{ts,js} : Tests run with
LOG_TRANSPORTS=File LOG_FILE=/dev/null jestto suppress log output.packages/matrix-identity-server/package.json (1)
40-40: Exactly the right script hardening.Line 40 replaces shell-specific env assignment with
cross-envand keeps Jest semantics intact. No nonsense, just safer execution across dev machines.Based on learnings: Applies to /tests//*.{ts,js} : Tests run with
LOG_TRANSPORTS=File LOG_FILE=/dev/null jestto suppress log output.packages/matrix-resolve/package.json (1)
37-37: Good, consistent portability fix.Line 37 keeps the same Jest+log suppression setup and removes shell-specific behavior. This is the kind of boring change that prevents stupid CI fires.
Based on learnings: Applies to /tests//*.{ts,js} : Tests run with
LOG_TRANSPORTS=File LOG_FILE=/dev/null jestto suppress log output.packages/federated-identity-service/package.json (1)
38-38: No issues here—cross-env is already declared at the workspace root and the pattern matches 8+ other packages.The change at Line 38 uses
cross-envto handle platform-agnostic environment variable injection. This is not a new risk:cross-envis already declared as a devDependency in the root package.json ("^10.1.0"), and the identical pattern is used consistently across packages/utils, packages/tom-server, packages/matrix-resolve, packages/matrix-identity-server, and others. The LOG_TRANSPORTS suppression aligns with test infrastructure expectations. Ship it..coderabbit.yaml (1)
12-12: Good switch: walkthrough summaries enabled.
high_level_summary_in_walkthrough: trueat Line 12 is clean, schema-valid, and useful for review visibility.
| resolve(true) | ||
| "/_matrix/identity/v2": badMethod, | ||
| "/_matrix/identity/versions": badMethod, | ||
| "/_matrix/identity/v2/account": badMethod, |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
| ) | ||
| buildRedactedUserSummary(userInfo), | ||
| )}`, | ||
| ); |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
| /^(.).*(@.+)$/, | ||
| "$1***$2", | ||
| )}"`, | ||
| ); |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
packages/matrix-identity-server/src/cron/update-federated-identity-hashes.ts
Fixed
Show fixed
Hide fixed
packages/matrix-identity-server/src/cron/update-federated-identity-hashes.ts
Fixed
Show fixed
Hide fixed
packages/matrix-identity-server/src/cron/update-federated-identity-hashes.ts
Fixed
Show fixed
Hide fixed
Signed-off-by: Pierre 'McFly' Marty <pmarty@linagora.com>
7005c46 to
61812dc
Compare

What
Why
Fundamental Issue
The flaw: npm scripts set environment variables with POSIX shell syntax (LOG_TRANSPORTS=File LOG_FILE=/dev/null jest), which breaks on Windows and any non-POSIX shells — making developer workflows non-portable.
Systemic/data-flow / core logic changes
These are purely stylistic; no logic or query behavior altered.
Dependency / lockfile changes
Tooling / automation changes
Effect: stronger automated review alignment with project conventions and automated label application.
Deprecated APIs / removed legacy code
Ignored technical debt
Risk & impact