Skip to content

Logging system improvements: privacy, dedup, server identification, and log viewer enhancements#3230

Merged
jeanfbrito merged 8 commits intodevfrom
fix/logging-system-improvements
Mar 2, 2026
Merged

Logging system improvements: privacy, dedup, server identification, and log viewer enhancements#3230
jeanfbrito merged 8 commits intodevfrom
fix/logging-system-improvements

Conversation

@jeanfbrito
Copy link
Copy Markdown
Member

@jeanfbrito jeanfbrito commented Mar 2, 2026

Summary

Comprehensive overhaul of the logging system focused on privacy, performance, usability, and developer experience.

  • Privacy hook hardened with industry-standard redaction patterns — JWT detection, credit card validation (Luhn checksum), URL credential scrubbing, IP masking, and partial masking for better debugging context
  • Log deduplication — suppresses consecutive identical log lines at the file transport level, reducing log spam from repeated webview warnings while keeping errors always logged
  • Server identification in logs — webview log entries now include [server-N] tags so logs from different workspaces can be distinguished
  • Log viewer UI — added server filter dropdown, "Show Server" toggle, server name resolution (maps server-N to workspace name/URL), and fixed entry limit to apply after filtering
  • Async file writes — enabled electron-log's async write queue to avoid blocking the main thread
  • Verbose Logging toggle in Developer Settings — lets users enable debug-level logging without restarting
  • Buffered errors.jsonl — batches error writes instead of one-per-call, with 5MB size cap
  • Dead code removal — removed unused utility functions and constants

Changes

Privacy (src/logging/privacy.ts)

  • JWT tokens detected and partially masked (eyJh...xK9s)
  • URLs with embedded credentials (https://user:pass@host) — password redacted
  • Credit card numbers validated with Luhn checksum before redacting (no false positives)
  • Long hex tokens (32+ chars) partially masked
  • Public IP addresses partially masked (1.2.*.*), localhost/private ranges preserved
  • Email regex tightened — no longer matches package scopes (@rocket.chat/fuselage) or version strings
  • Credential key-value patterns require 8+ char values to skip short debug strings
  • Object key redaction expanded to 16 patterns with safe-key allowlist
  • Partial masking replaces full [REDACTED] where possible for debugging utility
  • Max recursion depth (10) prevents stack overflow on deeply nested objects

Deduplication (src/logging/dedup.ts — new)

  • Simple "skip if identical to last message" strategy
  • Strips dynamic numbers from messages for smarter matching
  • Errors always pass through, only warnings and below are deduped
  • Two integration points: IPC handler (before electron-log) and file transport hook

Server Identification (src/logging/preload.ts, src/logging/index.ts)

  • Preload script queries main process for server index via synchronous IPC
  • Main process matches window.location.origin against Redux server list
  • Log entries from webviews now show [renderer:webview] [server-1] [OutlookCalendar]
  • Server mapping IPC handler for log viewer UI resolution

Log Viewer (src/logViewerWindow/)

  • Server filter dropdown — filter logs by specific workspace
  • "Show Server" toggle — show/hide server name chips on log entries
  • Server name resolutionserver-1 displayed as workspace title/URL via IPC
  • Entry limit applied post-filter — "Last 100 entries" now means last 100 matching entries, not 100 loaded then filtered

Settings

  • Verbose Logging toggle in Developer tab — switches log level between info and debug at runtime
  • User-friendly description: "Writes all console output to the log file. When disabled, only errors and important messages are saved."

Other

  • Async file writes (log.transports.file.sync = false)
  • Buffered errors.jsonl with 10s flush interval and 50-entry cap
  • Removed unused logInfo, logWarn, logError, logDebug from utils.ts
  • Removed unused MAX_LOG_FILE_SIZE from constants.ts
  • errors.json renamed to errors.jsonl in cleanup protected files

Test plan

  • Open log viewer — verify server names appear as chips on webview log entries
  • Toggle "Show Server" off — server chips disappear
  • Select a specific server in filter — only that server's logs shown
  • Filter by context (e.g. Outlook Calendar) with "Last 100 entries" — shows 100 matching entries
  • Enable Verbose Logging in Settings > Developer — debug messages appear in log file
  • Disable Verbose Logging — debug messages stop appearing
  • Verify privacy redaction: emails partially masked, no JWT/tokens in plain text
  • Verify dedup: repeated identical warnings don't spam the log file
  • Verify errors.jsonl is written and capped at 5MB

Summary by CodeRabbit

  • New Features

    • Debug logging toggle in Developer settings (persisted; migration defaults it off).
    • Log Viewer: server display/filter, server-mapping retrieval, incremental tail reads, clear-logs confirmation, and show-server UI.
  • Improvements

    • Smarter, layered privacy redaction and NDJSON-formatted error logging.
    • Log deduplication and rate-limiting to reduce noise.
    • Improved locale loading for the Log Viewer.

… writes

- Add Debug Logging toggle in Developer Settings (runtime log level switch)
- Add log deduplication: skip consecutive identical non-error messages at
  file transport and IPC boundary, keeping logs clean and lightweight
- Enable async file writes (electron-log batching) to avoid blocking main thread
- Buffer errors.jsonl writes with periodic flush instead of per-error appendFile
- Fix privacy hook ordering: redact data before writing to errors.jsonl
- Fix IPC rate limit memory leak: clean up on webContents destroy
- Add incremental log reading (byte offset tailing) for efficient auto-refresh
- Add clear logs confirmation dialog
- Add scoped logger process context
- Add log viewer i18n locale detection
- Remove dead code (unused log wrappers, constants, background color fn)
- Change search filter to session-only state for privacy
- Clear authorized log paths on window close
- Add missing IPC log levels (verbose, silly, default)
Add server-N tags to webview log entries so logs from different
workspaces can be distinguished. The preload script queries the main
process for the server index via a synchronous IPC handler that matches
window.location.origin against the Redux server list.

Log viewer UI gains a "Show Server" toggle, server filter dropdown,
and server name resolution (server-N mapped to workspace title/URL
via a new get-server-mapping IPC handler).
Load all entries from disk and apply the entry limit as a display cap
on filtered results. Previously "Last 100 entries" loaded 100 from disk
then filtered, showing fewer matches. Now it shows the last 100 entries
matching the current filters.
- Add JWT detection and partial masking (eyJh...xK9s)
- Add URL credential detection (https://user:pass@host)
- Add credit card detection with Luhn checksum validation
- Add long hex token detection (32+ char API keys/hashes)
- Add IP address partial masking (preserve localhost/private ranges)
- Add webhook URL and client secret patterns
- Require 8+ char values on credential patterns to reduce false positives
- Fix email regex to exclude package scopes and file extensions
- Use partial masking instead of full [REDACTED] for better debugging
- Add safe-key allowlist (token_type, password_policy, etc.)
- Add max depth protection against stack overflow on nested objects
- Update verbose logging toggle description for clarity
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99751af and 78503e4.

📒 Files selected for processing (1)
  • src/logging/privacy.ts
📜 Recent 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). (3)
  • GitHub Check: check (macos-latest)
  • GitHub Check: check (ubuntu-latest)
  • GitHub Check: check (windows-latest)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript strict mode enabled in TypeScript configuration
Use React functional components with hooks instead of class components
Follow FSA (Flux Standard Action) pattern for Redux actions
Use camelCase for file names and PascalCase for component file names
All code must pass ESLint and TypeScript checks
Write self-documenting code with clear naming; avoid unnecessary comments except for complex business logic or non-obvious decisions
Use Fuselage components from @rocket.chat/fuselage for all UI work and only create custom components when Fuselage doesn't provide what's needed
Check Theme.d.ts for valid color tokens when using Fuselage components
Use defensive coding with optional chaining and fallbacks for Linux-only APIs (process.getuid(), process.getgid(), process.geteuid(), process.getegid()) to ensure cross-platform compatibility across Windows, macOS, and Linux

Files:

  • src/logging/privacy.ts
🔇 Additional comments (7)
src/logging/privacy.ts (7)

14-33: LGTM!

The helper functions are well-implemented:

  • mask correctly handles edge cases for short strings
  • luhnCheck is a standard, correct implementation of the Luhn algorithm for credit card validation

42-85: LGTM!

The credential key-value patterns appropriately require 8+ character values to reduce false positives on debug strings while still catching actual credentials.


88-112: LGTM!

The token patterns are well-designed with appropriate thresholds. The URL credential handling now properly redacts both username and password.


114-164: LGTM!

The PII patterns are well-implemented:

  • Email detection correctly excludes common false positives (package scopes, file extensions)
  • Credit card detection uses Luhn validation to minimize false positives
  • IPv4 masking correctly handles RFC 1918 private ranges with the proper 172.16-31.*.* check

168-205: LGTM!

The field-based redaction logic is well-designed with an allowlist-first approach. The exact-match for safe patterns and substring-match for sensitive patterns provides appropriate granularity.


259-301: LGTM!

The core redaction functions are well-implemented:

  • Proper lastIndex reset for global regexes prevents matching issues
  • Depth limit correctly enforced at >= 10
  • Circular reference detection properly handles shared objects
  • The spread-safety check for redactedRest correctly handles non-object returns

307-332: LGTM!

The privacy hook implementation is robust:

  • Correctly normalizes message.data to an array
  • Appropriate error handling that avoids recursion by writing directly to stderr
  • The single-fire flag prevents log spam on repeated failures
  • Fallback preserves log level and timestamp while replacing data with a safe placeholder

Walkthrough

Adds a persisted debug-logging flag with UI toggle and runtime watch; extends log viewer with server tagging, server filtering, incremental tail reads, and new IPC endpoints; implements logging deduplication, layered privacy redaction, NDJSON error buffering/rotation, and locale-aware i18n loading for the log viewer.

Changes

Cohort / File(s) Summary
Persisted Debug Flag & Wiring
src/app/PersistableValues.ts, src/store/rootReducer.ts, src/main.ts
Add isDebugLoggingEnabled to persistable values (v4.13.0 migration), expose it via selectors, wire reducer into root reducer, and call setupDebugLoggingWatch() at startup.
Debug Logging Action & Reducer
src/ui/actions.ts, src/ui/reducers/isDebugLoggingEnabled.ts
Add SETTINGS_SET_DEBUG_LOGGING_CHANGED action and isDebugLoggingEnabled reducer to manage the debug-toggle state and initialize from loaded settings.
Debug Logging UI
src/ui/components/SettingsView/features/DebugLogging.tsx, src/ui/components/SettingsView/DeveloperTab.tsx
New DebugLogging React component and insertion into DeveloperTab; reads Redux flag and dispatches toggle action.
Persisted Selectors
src/app/selectors.ts
Expose isDebugLoggingEnabled from selectPersistableValues.
Log Viewer: UI, Entry & Types
src/logViewerWindow/logViewerWindow.tsx, src/logViewerWindow/LogEntry.tsx, src/logViewerWindow/types.ts
Add server-tag parsing/display and server chip rendering, showServer and serverMapping state/props, server filtering UI/logic, incremental tail-read handling with last-known-size tracking, and optional fileSize/tail response types.
Log Viewer Window / i18n / IPC / Constants
src/logViewerWindow/log-viewer-window.tsx, src/logViewerWindow/ipc.ts, src/logViewerWindow/constants.ts, src/ipc/channels.ts
Dynamic locale detection/resource loading for the log viewer; add IPC handlers log-viewer-window/read-logs-tail, log-viewer-window/confirm-clear-logs, log-viewer-window/get-server-mapping; remove MAX_LOG_FILE_SIZE; extend read responses with size/mtime and wire i18n into IPC flows.
Logging: Deduplication & File Hook
src/logging/dedup.ts, src/logging/index.ts
Add LogDeduplicator class with IPC and file-transport deduplication; wire dedup hooks into logging pipeline and expose setupDebugLoggingWatch().
Logging: Privacy Redaction
src/logging/privacy.ts
Replace simple redaction with layered approach: credential KV patterns, token patterns, PII patterns (email/CC/IP), partial masking, Luhn checks, depth-limited object recursion, and allowlist/denylist logic.
Logging: Errors & Cleanup
src/logging/index.ts, src/logging/cleanup.ts
Switch error logging to buffered NDJSON errors.jsonl with periodic flush, size-based truncation, and update protected files list (errors.jsonl).
Logging: Preload, Scopes, Utils
src/logging/preload.ts, src/logging/scopes.ts, src/logging/utils.ts
Add server-tag retrieval in renderer webview preload via sync IPC; prefix scoped log output with process context; remove legacy helper wrappers (logInfo, logWarn, logDebug, logError).
Log Viewer Translations
src/i18n/en.i18n.json
Add translations for clear-logs dialog, debug/detailed logging text, and log viewer server filter / showServer controls.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant UI as Log Viewer UI
    participant Main as Main Process
    participant FS as File System

    User->>UI: Request server mapping / on load
    UI->>Main: IPC: log-viewer-window/get-server-mapping()
    Main->>Main: Read servers from store & build mapping
    Main-->>UI: { success: true, mapping }

    User->>UI: Trigger incremental read (tail)
    UI->>Main: IPC: log-viewer-window/read-logs-tail({ fromByte, filePath? })
    Main->>FS: Read file from offset
    FS-->>Main: { logs, newSize, lastModifiedTime }
    Main-->>UI: { success: true, logs, newSize, lastModifiedTime }
    UI->>UI: Append incremental logs and re-render filtered results
Loading
sequenceDiagram
    participant App as App Logger
    participant Dedup as LogDeduplicator
    participant Privacy as Privacy Hook
    participant File as File Transport

    App->>Dedup: shouldLog(level, context, args)
    Dedup-->>App: allow/suppress
    App->>Privacy: redactSensitiveData(entry)
    Privacy-->>App: redactedEntry
    App->>File: file transport hook (write redactedEntry)
    File->>Dedup: file transport hook dedup check
    File->>File: Append NDJSON error / rotate errors.jsonl as needed
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main changes: logging system improvements across privacy, deduplication, server identification, and log viewer enhancements, which align with the comprehensive changeset.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/logging/index.ts (1)

396-411: ⚠️ Potential issue | 🟠 Major

Use event.sender.id for rate limiting instead of renderer-supplied webContentsId.

The console-log IPC handler uses renderer-supplied webContentsId (line 399) and serverUrl (lines 420–431) for rate limiting and server attribution. A malicious renderer can send arbitrary values in the IPC message—even if injected correctly at execution time (line 313), the renderer controls what it sends over IPC. This enables:

  • Rate limit bypass: Send different spoofed webContentsId values to defeat per-process throttling
  • Server attribution forgery: Send arbitrary serverUrl values to forge which server the logs came from

Use event.sender.id (the authenticated sender from Electron's IPC event) for the rate limit key and senderWebContents.getURL() for server matching instead.

🔧 Proposed fix
       (event, level, webContentsId, serverUrl, ...args) => {
         try {
+          const senderId = event.sender.id;
           const now = Date.now();
-          let rateState = ipcRateLimit.get(webContentsId);
+          let rateState = ipcRateLimit.get(senderId);
           if (!rateState || now > rateState.resetTime) {
             rateState = { count: 0, resetTime: now + 1000 };
-            ipcRateLimit.set(webContentsId, rateState);
+            ipcRateLimit.set(senderId, rateState);
           }
           rateState.count++;
           if (rateState.count > MAX_IPC_MESSAGES_PER_SECOND) {
             return;
           }
-          // Find the webContents that sent this message
-          const senderWebContents =
-            webContents.fromId(webContentsId) || event.sender;
+          const senderWebContents = event.sender;

           // Create enhanced context string with server info
           const context = getLogContext(senderWebContents);
           let contextStr = formatLogContext(context);

           // Add server index to webview context
           if (
             selectFunction &&
-            serverUrl &&
-            serverUrl !== 'unknown' &&
             senderWebContents.getType() === 'webview'
           ) {
             try {
+              const currentUrl = senderWebContents.getURL();
               const servers = selectFunction(
                 (state: RootState) => state.servers
               );
               const serverIndex =
                 servers.findIndex(
                   (s: any) =>
-                    s.url === serverUrl
+                    s.url && currentUrl.startsWith(s.url.replace(/\/$/, ''))
                 ) + 1;
               if (serverIndex > 0) {
                 contextStr = contextStr.replace(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/logging/index.ts` around lines 396 - 411, The IPC console-log handler
currently trusts renderer-supplied webContentsId and serverUrl for rate-limiting
and attribution; update the handler to use event.sender.id as the rate-limit key
(replace uses of webContentsId when accessing ipcRateLimit and counting against
MAX_IPC_MESSAGES_PER_SECOND) and derive the origin URL from the authenticated
sender (use senderWebContents.getURL() after computing senderWebContents from
event.sender or webContents.fromId) instead of using the renderer-supplied
serverUrl; adjust any logic that falls back to webContents.fromId(...) so it
always treats event.sender as the authoritative source for id and URL.
🧹 Nitpick comments (1)
src/ipc/channels.ts (1)

98-122: Keep IPC contracts centralized by typing the server-tag channel too.

src/logging/preload.ts sends 'log-viewer-window/get-server-tag', but that channel is not present in ChannelToArgsMap. Adding it here preserves compile-time contract checks.

💡 Proposed addition
   'log-viewer-window/get-server-mapping': () => {
     success: boolean;
     mapping: Record<string, string>;
   };
+  'log-viewer-window/get-server-tag': (
+    origin: string
+  ) => string | undefined;
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ipc/channels.ts` around lines 98 - 122, Channel contract missing for the
server-tag channel: add an entry for 'log-viewer-window/get-server-tag' into
ChannelToArgsMap with the correct request/response shape so TypeScript checks
cover preload.ts; for example, add a mapping from () => { success: boolean;
tag?: string; error?: string } under the ChannelToArgsMap object to mirror other
log-viewer-window contracts and ensure compile-time verification.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/logging/dedup.ts`:
- Around line 19-25: The makeKey method can throw when JSON.stringify is given
circular or non-serializable values; update makeKey in src/logging/dedup.ts to
safely serialize each arg instead of calling JSON.stringify directly: for each
arg in the args array attempt JSON.stringify in a try/catch and on failure fall
back to a safe, non-throwing representation (e.g., use String(a), a.toString(),
or util.inspect(a) with a fallback for BigInt), ensuring no exceptions propagate
from makeKey; preserve the existing replacements (.replace(/\b\d{4,}\b/g, '#')
and .replace(/\b\d+\.\d+\b/g, '#')) and continue returning `${level}|${text}`.
- Around line 12-13: The deduplication state is shared via the single field
lastKey causing IPC and file transport to interfere; add two separate fields
(e.g., lastIpcKey and lastFileKey) on the LogDeduplicator class, initialize them
like the current lastKey, update shouldLog(...) to read/update lastIpcKey only,
and update createFileHook(...) (and any file-write-related helpers) to
read/update lastFileKey only so IPC and file deduplication are isolated.

In `@src/logging/index.ts`:
- Around line 148-173: flushErrorJsonl currently appends errorJsonlBuffer using
fs.promises.appendFile without awaiting, and the before-quit handler invokes
flushErrorJsonl synchronously so logs can be lost on fast shutdown; modify
flushErrorJsonl (and any caller such as the before-quit handler) to perform a
synchronous write path during shutdown: expose a new synchronous flush path
inside flushErrorJsonl that uses fs.existsSync/fs.statSync and fs.writeFileSync
or fs.appendFileSync to truncate and append to errorJsonlPath when called with a
shutdown flag (or call a new flushErrorJsonlSync helper), ensure it handles
MAX_ERROR_LOG_SIZE truncation the same way, and update the before-quit handler
to call the synchronous variant (flushErrorJsonlSync or flushErrorJsonl(true))
so the process writes logs to disk before exit.

In `@src/logging/privacy.ts`:
- Around line 148-157: The current replacer in the IP redaction logic (pattern:
... , replacer: (m) => { ... }) incorrectly treats all 172.* addresses as
private; update the condition so only 172.16.0.0–172.31.255.255 are exempted.
Replace the m.startsWith('172.') check with a precise test (e.g. parse the
second octet with m.split('.') and ensure parseInt(octets[1]) is between 16 and
31 inclusive, or use a regex like /^172\.(1[6-9]|2[0-9]|3[01])\./) inside the
replacer so public 172.x.x.x addresses are masked. Ensure you keep existing
exemptions (127.0.0.1, 0.0.0.0, 192.168.*, 10.*) and only alter the 172 check.

In `@src/logViewerWindow/ipc.ts`:
- Around line 325-356: The IPC handler should validate and sanitize
options.fromByte before numeric ops: in the async handler that reads options ({
fromByte: number; filePath?: string }), check that options.fromByte is a finite
integer (e.g., typeof === 'number' && Number.isFinite(...) &&
Number.isInteger(...)) or coerce it safely (Number(...) and floor) and fallback
to 0 if invalid, then use that sanitized value when computing fromByte =
Math.max(0, Math.min(sanitizedFromByte, stats.size)); this prevents NaN being
passed to fs.createReadStream or other downstream APIs.

---

Outside diff comments:
In `@src/logging/index.ts`:
- Around line 396-411: The IPC console-log handler currently trusts
renderer-supplied webContentsId and serverUrl for rate-limiting and attribution;
update the handler to use event.sender.id as the rate-limit key (replace uses of
webContentsId when accessing ipcRateLimit and counting against
MAX_IPC_MESSAGES_PER_SECOND) and derive the origin URL from the authenticated
sender (use senderWebContents.getURL() after computing senderWebContents from
event.sender or webContents.fromId) instead of using the renderer-supplied
serverUrl; adjust any logic that falls back to webContents.fromId(...) so it
always treats event.sender as the authoritative source for id and URL.

---

Nitpick comments:
In `@src/ipc/channels.ts`:
- Around line 98-122: Channel contract missing for the server-tag channel: add
an entry for 'log-viewer-window/get-server-tag' into ChannelToArgsMap with the
correct request/response shape so TypeScript checks cover preload.ts; for
example, add a mapping from () => { success: boolean; tag?: string; error?:
string } under the ChannelToArgsMap object to mirror other log-viewer-window
contracts and ensure compile-time verification.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cf1439 and 1721a17.

📒 Files selected for processing (23)
  • src/app/PersistableValues.ts
  • src/app/selectors.ts
  • src/i18n/en.i18n.json
  • src/ipc/channels.ts
  • src/logViewerWindow/LogEntry.tsx
  • src/logViewerWindow/constants.ts
  • src/logViewerWindow/ipc.ts
  • src/logViewerWindow/log-viewer-window.tsx
  • src/logViewerWindow/logViewerWindow.tsx
  • src/logViewerWindow/types.ts
  • src/logging/cleanup.ts
  • src/logging/dedup.ts
  • src/logging/index.ts
  • src/logging/preload.ts
  • src/logging/privacy.ts
  • src/logging/scopes.ts
  • src/logging/utils.ts
  • src/main.ts
  • src/store/rootReducer.ts
  • src/ui/actions.ts
  • src/ui/components/SettingsView/DeveloperTab.tsx
  • src/ui/components/SettingsView/features/DebugLogging.tsx
  • src/ui/reducers/isDebugLoggingEnabled.ts
💤 Files with no reviewable changes (2)
  • src/logViewerWindow/constants.ts
  • src/logging/utils.ts
📜 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). (3)
  • GitHub Check: check (macos-latest)
  • GitHub Check: check (windows-latest)
  • GitHub Check: check (ubuntu-latest)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript strict mode enabled in TypeScript configuration
Use React functional components with hooks instead of class components
Follow FSA (Flux Standard Action) pattern for Redux actions
Use camelCase for file names and PascalCase for component file names
All code must pass ESLint and TypeScript checks
Write self-documenting code with clear naming; avoid unnecessary comments except for complex business logic or non-obvious decisions
Use Fuselage components from @rocket.chat/fuselage for all UI work and only create custom components when Fuselage doesn't provide what's needed
Check Theme.d.ts for valid color tokens when using Fuselage components
Use defensive coding with optional chaining and fallbacks for Linux-only APIs (process.getuid(), process.getgid(), process.geteuid(), process.getegid()) to ensure cross-platform compatibility across Windows, macOS, and Linux

Files:

  • src/logging/preload.ts
  • src/logging/dedup.ts
  • src/ui/reducers/isDebugLoggingEnabled.ts
  • src/ui/actions.ts
  • src/logging/cleanup.ts
  • src/ui/components/SettingsView/features/DebugLogging.tsx
  • src/app/PersistableValues.ts
  • src/ui/components/SettingsView/DeveloperTab.tsx
  • src/logViewerWindow/types.ts
  • src/logging/index.ts
  • src/app/selectors.ts
  • src/ipc/channels.ts
  • src/logViewerWindow/logViewerWindow.tsx
  • src/store/rootReducer.ts
  • src/logging/privacy.ts
  • src/logViewerWindow/log-viewer-window.tsx
  • src/main.ts
  • src/logViewerWindow/ipc.ts
  • src/logViewerWindow/LogEntry.tsx
  • src/logging/scopes.ts
🧠 Learnings (7)
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/preload.ts : In `preload.ts`, keep logging minimal as it runs in the renderer process and cannot access the centralized `global.isVerboseOutlookLoggingEnabled` variable, causing all logs to always appear

Applied to files:

  • src/logging/preload.ts
  • src/logging/index.ts
  • src/main.ts
  • src/logging/scopes.ts
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/*@(calendar|outlook)*.{ts,tsx} : Always use the centralized logger from `logger.ts` (import `outlookLog`, `outlookError`, `outlookWarn`, or `outlookDebug`) instead of using `console.log` directly for Outlook Calendar module logging

Applied to files:

  • src/logging/preload.ts
  • src/logging/index.ts
  • src/main.ts
  • src/i18n/en.i18n.json
  • src/logging/scopes.ts
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/*@(calendar|outlook)*.{ts,tsx} : Use `outlookError()` for errors that should always be logged regardless of verbose mode settings, since error visibility is critical for debugging

Applied to files:

  • src/logging/preload.ts
  • src/i18n/en.i18n.json
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/*@(calendar|outlook)*.{ts,tsx} : Use `outlookLog()`, `outlookWarn()`, and `outlookDebug()` only when verbose logging is expected to be enabled - they respect the verbose logging toggle from Settings > Developer > Verbose Outlook Logging

Applied to files:

  • src/ui/actions.ts
  • src/ui/components/SettingsView/features/DebugLogging.tsx
  • src/app/PersistableValues.ts
  • src/ui/components/SettingsView/DeveloperTab.tsx
  • src/logging/index.ts
  • src/app/selectors.ts
  • src/main.ts
  • src/i18n/en.i18n.json
  • src/logging/scopes.ts
📚 Learning: 2026-02-04T19:29:54.650Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T19:29:54.650Z
Learning: Applies to **/*.{ts,tsx} : Use Fuselage components from `rocket.chat/fuselage` for all UI work and only create custom components when Fuselage doesn't provide what's needed

Applied to files:

  • src/ui/components/SettingsView/features/DebugLogging.tsx
  • src/ui/components/SettingsView/DeveloperTab.tsx
  • src/logViewerWindow/LogEntry.tsx
📚 Learning: 2026-02-04T19:29:54.650Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T19:29:54.650Z
Learning: Applies to **/*.{ts,tsx} : Use defensive coding with optional chaining and fallbacks for Linux-only APIs (process.getuid(), process.getgid(), process.geteuid(), process.getegid()) to ensure cross-platform compatibility across Windows, macOS, and Linux

Applied to files:

  • src/logging/index.ts
📚 Learning: 2026-02-04T19:29:54.650Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T19:29:54.650Z
Learning: Applies to **/*.{ts,tsx} : Check `Theme.d.ts` for valid color tokens when using Fuselage components

Applied to files:

  • src/logViewerWindow/LogEntry.tsx
🧬 Code graph analysis (11)
src/ui/reducers/isDebugLoggingEnabled.ts (3)
src/store/actions.ts (1)
  • ActionOf (42-42)
src/ui/actions.ts (1)
  • SETTINGS_SET_DEBUG_LOGGING_CHANGED (129-130)
src/app/actions.ts (1)
  • APP_SETTINGS_LOADED (6-6)
src/ui/components/SettingsView/features/DebugLogging.tsx (5)
src/ui/reducers/isDebugLoggingEnabled.ts (1)
  • isDebugLoggingEnabled (11-27)
src/store/rootReducer.ts (1)
  • RootState (123-123)
src/store/index.ts (1)
  • dispatch (38-41)
src/store/actions.ts (1)
  • RootAction (44-46)
src/ui/actions.ts (1)
  • SETTINGS_SET_DEBUG_LOGGING_CHANGED (129-130)
src/ui/components/SettingsView/DeveloperTab.tsx (1)
src/ui/components/SettingsView/features/DebugLogging.tsx (1)
  • DebugLogging (22-58)
src/logging/index.ts (6)
src/logging/dedup.ts (1)
  • LogDeduplicator (10-66)
src/logging/privacy.ts (2)
  • createPrivacyHook (306-331)
  • redactSensitiveData (235-257)
src/store/rootReducer.ts (1)
  • RootState (123-123)
src/urls.ts (1)
  • server (20-34)
src/logging/context.ts (2)
  • getLogContext (216-237)
  • formatLogContext (242-259)
src/store/index.ts (1)
  • select (66-67)
src/app/selectors.ts (2)
src/store/rootReducer.ts (1)
  • RootState (123-123)
src/ui/reducers/isDebugLoggingEnabled.ts (1)
  • isDebugLoggingEnabled (11-27)
src/logViewerWindow/logViewerWindow.tsx (2)
src/logViewerWindow/types.ts (2)
  • ReadLogsTailResponse (67-67)
  • ClearLogsResponse (70-70)
src/logViewerWindow/LogEntry.tsx (1)
  • LogEntry (61-138)
src/logViewerWindow/log-viewer-window.tsx (2)
src/i18n/common.ts (1)
  • fallbackLng (3-3)
src/i18n/renderer.ts (1)
  • setupI18n (9-34)
src/main.ts (1)
src/logging/index.ts (1)
  • setupDebugLoggingWatch (506-524)
src/logViewerWindow/ipc.ts (4)
src/servers/reducers.ts (1)
  • servers (102-277)
src/store/index.ts (1)
  • select (66-67)
src/store/rootReducer.ts (1)
  • RootState (123-123)
src/urls.ts (1)
  • server (20-34)
src/logViewerWindow/LogEntry.tsx (1)
src/logViewerWindow/types.ts (1)
  • LogEntryType (65-65)
src/logging/scopes.ts (1)
src/logging/context.ts (1)
  • getProcessContext (34-65)
🔇 Additional comments (20)
src/logging/cleanup.ts (1)

8-8: LGTM!

The update from errors.json to errors.jsonl correctly aligns with the PR's migration to NDJSON format for error logging.

src/app/PersistableValues.ts (2)

105-112: LGTM!

The new PersistableValues_4_13_0 type and updated PersistableValues definition follow the established versioned type pattern correctly.


200-203: LGTM!

The migration correctly initializes isDebugLoggingEnabled to false, which is a sensible default (debug logging should be opt-in).

src/logViewerWindow/types.ts (2)

25-25: LGTM!

Adding fileSize to IReadLogsResponse enables tracking file size for incremental reading, consistent with the PR's tail reading feature.


30-36: LGTM!

The new IReadLogsTailResponse interface is well-designed for incremental log reading, providing the necessary fields (newSize, lastModifiedTime) to track file state between reads.

Also applies to: 67-67

src/ui/components/SettingsView/DeveloperTab.tsx (1)

4-4: LGTM!

The DebugLogging component is properly imported and positioned at the top of the logging section, which makes sense as it's a general debug toggle that should precede the more specific verbose logging options.

Also applies to: 17-17

src/main.ts (1)

23-28: LGTM!

The setupDebugLoggingWatch call is correctly positioned after createMainReduxStore(), ensuring the Redux store is available when the watcher initializes. The implementation's defensive try/catch provides a safety net for edge cases.

Also applies to: 82-82

src/store/rootReducer.ts (1)

26-26: LGTM!

The isDebugLoggingEnabled reducer is properly imported and integrated into the root reducer, correctly extending RootState to include the new debug logging state.

Also applies to: 113-113

src/app/selectors.ts (1)

84-85: LGTM!

The isDebugLoggingEnabled selector is correctly added to selectPersistableValues, ensuring the debug logging preference is persisted across app sessions.

src/ui/actions.ts (1)

129-130: LGTM!

The new SETTINGS_SET_DEBUG_LOGGING_CHANGED action follows the established FSA pattern and naming conventions, with a correct boolean payload type for the toggle setting.

Also applies to: 268-268

src/logging/scopes.ts (1)

3-27: Looks good: scoped logs now include stable process context.

This is a solid observability improvement and keeps the logger API unchanged.

src/i18n/en.i18n.json (1)

167-174: Translation additions are well-scoped and consistent.

New keys match the introduced clear-logs, verbose logging, and server filter UX.

Also applies to: 327-331, 561-562, 600-603

src/logViewerWindow/log-viewer-window.tsx (1)

42-76: Locale detection and bundle loading flow looks correct.

Good fallback strategy and clean integration into setupI18n.

src/logging/preload.ts (1)

11-25: Server tag enrichment is integrated cleanly with existing console override flow.

Fallback behavior remains safe when IPC is unavailable.

Also applies to: 41-86

src/ui/reducers/isDebugLoggingEnabled.ts (1)

7-27: Reducer implementation is solid.

State initialization and action handling are consistent with the new setting lifecycle.

src/ui/components/SettingsView/features/DebugLogging.tsx (1)

1-58: Nice implementation for the new developer setting toggle.

Component wiring (state, dispatch, i18n, and label association) is clean.

src/logViewerWindow/LogEntry.tsx (1)

72-87: Server-tag derivation and conditional rendering look solid.

The memoized server parsing and server/context chip split are clean and keep the row rendering predictable.

Also applies to: 117-125

src/logViewerWindow/logViewerWindow.tsx (2)

324-370: Filter + entry-limit ordering is correctly implemented.

Applying the limit after all filters is the right behavior for “last N matching entries.”


399-460: Incremental tail-update flow is well structured.

The truncate/rotate fallback plus tail-read append path is clear and resilient for normal streaming updates.

src/logging/index.ts (1)

133-140: Privacy-first hook ordering is correct.

Applying redaction before dedup/file handling is the right sequencing to avoid leaking sensitive data into downstream paths.

- Use event.sender.id for IPC rate limiting instead of renderer-supplied
  webContentsId to prevent spoofing
- Use senderWebContents.getURL() for server attribution instead of
  renderer-supplied serverUrl
- Separate IPC and file transport dedup keys to prevent interference
- Add try/catch in dedup makeKey to handle circular objects
- Use synchronous writes in flushErrorJsonl during shutdown to prevent
  data loss
- Fix IP address exemption: only 172.16-31.x.x are private (RFC 1918),
  not all 172.x.x.x
- Validate fromByte parameter in read-logs-tail IPC handler
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/logging/dedup.ts`:
- Around line 69-72: The dedup key generation currently uses
message.data?.map(String).join(' ') which converts non-string structured
payloads to "[object Object]" and can erroneously suppress distinct logs; update
the logic that builds text (used in key and compared to this.lastFileKey) to
serialize non-string items deterministically (e.g., if item is a string keep it,
otherwise JSON.stringify with a safe fallback for circular refs or use
util.inspect) so structured objects produce meaningful tokens; modify the code
around message.data, text and key (references: message.data, text, key,
this.lastFileKey) to use the safe serialization helper and ensure the rest of
the key normalization (digit masking) stays the same.

In `@src/logging/privacy.ts`:
- Around line 279-283: redactObject(rest, ...) can return a non-object sentinel
(e.g. string), so do not spread its result unguarded; instead assign const
redactedRest = redactObject(rest, depth + 1, seen) and check its type: if typeof
redactedRest === 'object' && redactedRest !== null return { ...redactedRest,
state: '[Redux State Redacted]' }, otherwise return a stable object that
preserves the state key and carries the sentinel (for example return {
_redacted: redactedRest, state: '[Redux State Redacted]' }) so callers never
receive a corrupted shape; update the code around redactObject/rest accordingly.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1721a17 and 8e9d09a.

📒 Files selected for processing (4)
  • src/logViewerWindow/ipc.ts
  • src/logging/dedup.ts
  • src/logging/index.ts
  • src/logging/privacy.ts
📜 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). (3)
  • GitHub Check: check (macos-latest)
  • GitHub Check: check (ubuntu-latest)
  • GitHub Check: check (windows-latest)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript strict mode enabled in TypeScript configuration
Use React functional components with hooks instead of class components
Follow FSA (Flux Standard Action) pattern for Redux actions
Use camelCase for file names and PascalCase for component file names
All code must pass ESLint and TypeScript checks
Write self-documenting code with clear naming; avoid unnecessary comments except for complex business logic or non-obvious decisions
Use Fuselage components from @rocket.chat/fuselage for all UI work and only create custom components when Fuselage doesn't provide what's needed
Check Theme.d.ts for valid color tokens when using Fuselage components
Use defensive coding with optional chaining and fallbacks for Linux-only APIs (process.getuid(), process.getgid(), process.geteuid(), process.getegid()) to ensure cross-platform compatibility across Windows, macOS, and Linux

Files:

  • src/logging/index.ts
  • src/logging/privacy.ts
  • src/logging/dedup.ts
  • src/logViewerWindow/ipc.ts
🧠 Learnings (4)
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/preload.ts : In `preload.ts`, keep logging minimal as it runs in the renderer process and cannot access the centralized `global.isVerboseOutlookLoggingEnabled` variable, causing all logs to always appear

Applied to files:

  • src/logging/index.ts
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/*@(calendar|outlook)*.{ts,tsx} : Always use the centralized logger from `logger.ts` (import `outlookLog`, `outlookError`, `outlookWarn`, or `outlookDebug`) instead of using `console.log` directly for Outlook Calendar module logging

Applied to files:

  • src/logging/index.ts
📚 Learning: 2026-02-04T19:30:03.354Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: src/outlookCalendar/AGENTS.md:0-0
Timestamp: 2026-02-04T19:30:03.354Z
Learning: Applies to src/outlookCalendar/**/*@(calendar|outlook)*.{ts,tsx} : Use `outlookLog()`, `outlookWarn()`, and `outlookDebug()` only when verbose logging is expected to be enabled - they respect the verbose logging toggle from Settings > Developer > Verbose Outlook Logging

Applied to files:

  • src/logging/index.ts
📚 Learning: 2026-02-04T19:29:54.650Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.Electron PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T19:29:54.650Z
Learning: Applies to **/*.{ts,tsx} : Use defensive coding with optional chaining and fallbacks for Linux-only APIs (process.getuid(), process.getgid(), process.geteuid(), process.getegid()) to ensure cross-platform compatibility across Windows, macOS, and Linux

Applied to files:

  • src/logging/index.ts
  • src/logViewerWindow/ipc.ts
🧬 Code graph analysis (1)
src/logViewerWindow/ipc.ts (2)
src/store/index.ts (1)
  • select (66-67)
src/store/rootReducer.ts (1)
  • RootState (123-123)
🔇 Additional comments (5)
src/logging/dedup.ts (1)

13-18: Good separation of IPC and file dedup state.

lastIpcKey and lastFileKey isolation is correct and prevents cross-channel suppression.

src/logging/privacy.ts (1)

148-157: Private 172.16.0.0/12 handling is correctly constrained.

The Line 156 check now precisely preserves only private 172 ranges while masking public 172.*.

src/logViewerWindow/ipc.ts (1)

354-359: fromByte sanitization is solid.

The numeric coercion + finite check + floor + clamp at Lines 355-359 is a good defensive boundary for createReadStream.

src/logging/index.ts (2)

214-217: Synchronous flush on shutdown is a strong reliability improvement.

Using flushErrorJsonl(true) in before-quit closes the async-loss gap for buffered errors.


406-409: Good trust-boundary handling for renderer log attribution.

Using event.sender/senderWebContents.getURL() instead of renderer-supplied IDs/URLs is the right security posture.

Also applies to: 427-443

Comment on lines +279 to +283
const { state: _state, ...rest } = obj;
return { ...redactObject(rest, seen), state: '[Redux State Redacted]' };
return {
...redactObject(rest, depth + 1, seen),
state: '[Redux State Redacted]',
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid spreading non-object redaction results.

At Line 281, redactObject(rest, ...) may return a sentinel string; spreading that corrupts the returned shape.

🔧 Proposed fix
-      return {
-        ...redactObject(rest, depth + 1, seen),
-        state: '[Redux State Redacted]',
-      };
+      const redactedRest = redactObject(rest, depth + 1, seen);
+      return {
+        ...(typeof redactedRest === 'object' && redactedRest !== null
+          ? redactedRest
+          : {}),
+        state: '[Redux State Redacted]',
+      };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/logging/privacy.ts` around lines 279 - 283, redactObject(rest, ...) can
return a non-object sentinel (e.g. string), so do not spread its result
unguarded; instead assign const redactedRest = redactObject(rest, depth + 1,
seen) and check its type: if typeof redactedRest === 'object' && redactedRest
!== null return { ...redactedRest, state: '[Redux State Redacted]' }, otherwise
return a stable object that preserves the state key and carries the sentinel
(for example return { _redacted: redactedRest, state: '[Redux State Redacted]'
}) so callers never receive a corrupted shape; update the code around
redactObject/rest accordingly.

- Dedup file hook: serialize structured objects with JSON.stringify
  instead of String() to produce meaningful dedup keys
- Privacy: guard redactObject spread against non-object return value
  when processing nested Redux state
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/logging/privacy.ts`:
- Around line 263-265: The depth check currently uses "if (depth > 10) return
'[Nested Object Redacted]';" which allows processing at depth 10 instead of
redacting at that limit; change the condition to "if (depth >= 10) return
'[Nested Object Redacted]';" (update the check that references the variable
depth and the redaction string '[Nested Object Redacted]') so the function
enforces a maximum depth of 10.
- Around line 104-106: The regex replacer currently preserves the captured
username because the replacer function only accepts (_m, proto, user) and then
injects user into the output; update the replacer to accept the password capture
as a third parameter (e.g., (_m, proto, user, pass)) and redact the username as
well as the password in the returned string (for example return
`${proto}[REDACTED]:[REDACTED]@` or a masked username) so both the username and
password captures from the pattern /(https?:\/\/)([^:]+):([^@]+)@/gi are
removed.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e9d09a and 99751af.

📒 Files selected for processing (2)
  • src/logging/dedup.ts
  • src/logging/privacy.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/logging/dedup.ts
📜 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). (3)
  • GitHub Check: check (macos-latest)
  • GitHub Check: check (windows-latest)
  • GitHub Check: check (ubuntu-latest)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript strict mode enabled in TypeScript configuration
Use React functional components with hooks instead of class components
Follow FSA (Flux Standard Action) pattern for Redux actions
Use camelCase for file names and PascalCase for component file names
All code must pass ESLint and TypeScript checks
Write self-documenting code with clear naming; avoid unnecessary comments except for complex business logic or non-obvious decisions
Use Fuselage components from @rocket.chat/fuselage for all UI work and only create custom components when Fuselage doesn't provide what's needed
Check Theme.d.ts for valid color tokens when using Fuselage components
Use defensive coding with optional chaining and fallbacks for Linux-only APIs (process.getuid(), process.getgid(), process.geteuid(), process.getegid()) to ensure cross-platform compatibility across Windows, macOS, and Linux

Files:

  • src/logging/privacy.ts
🔇 Additional comments (2)
src/logging/privacy.ts (2)

148-157: Precise 172.16.0.0/12 private-range handling looks good.

The current regex correctly exempts only 172.16172.31, not all 172.*.


280-284: Good defensive guard before spreading redactedRest.

This avoids shape corruption when nested redaction returns a non-object sentinel.

- Redact both username and password in URLs with embedded credentials
- Change depth check from > 10 to >= 10 to enforce max depth of 10
@jeanfbrito jeanfbrito merged commit 7c4cc6a into dev Mar 2, 2026
6 checks passed
@jeanfbrito jeanfbrito deleted the fix/logging-system-improvements branch March 2, 2026 20:28
@jeanfbrito jeanfbrito mentioned this pull request Mar 6, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant