Skip to content

Adjust outlook webhook logger#916

Merged
elie222 merged 6 commits intomainfrom
chore/outlook-webhook-logger
Nov 5, 2025
Merged

Adjust outlook webhook logger#916
elie222 merged 6 commits intomainfrom
chore/outlook-webhook-logger

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 5, 2025

Summary by CodeRabbit

  • Chores
    • Internal refactoring of Outlook webhook infrastructure to streamline logging and notification processing.
    • Version updated to v2.17.41.

@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 5, 2025 10:05pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Warning

Rate limit exceeded

@elie222 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 2363886 and 61f6a2e.

📒 Files selected for processing (3)
  • apps/web/utils/email/google.ts (3 hunks)
  • apps/web/utils/email/microsoft.ts (3 hunks)
  • apps/web/utils/email/types.ts (2 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The changes refactor logging across the Outlook webhook pipeline by removing locally-created loggers and propagating a Logger instance through the call chain instead. The dedicated process-history-item handler is removed, and logging responsibility shifts to upstream calling functions. A per-request scoped logger is introduced in the webhook route and threaded downstream.

Changes

Cohort / File(s) Summary
Webhook logging removal
apps/web/app/api/outlook/webhook/logger.ts
Deleted logger export and import of createScopedLogger; logging setup removed entirely from module.
Process history item handler removal
apps/web/app/api/outlook/webhook/process-history-item.ts
Removed entire file implementation including processHistoryItem function and ProcessHistoryOptions type.
Process history logger propagation
apps/web/app/api/outlook/webhook/process-history.ts
Updated processHistoryForUser to accept logger parameter; adjusted import paths; enhanced error handling with logger context; logger passed through to processHistoryItem call.
Webhook route logging refactor
apps/web/app/api/outlook/webhook/route.ts
Replaced local logger setup with scoped logger factory; introduced per-request logger instance; logger passed to processNotificationsAsync via after() and to processHistoryForUser calls; per-notification logger context created with subscriptionId and messageId.
Email utils logger propagation
apps/web/utils/email/microsoft.ts
Updated processHistory signature to accept logger parameter; updated imports to include Logger type; logger propagated to processHistoryForUser call.
Version bump
version.txt
Incremented version from v2.17.40 to v2.17.41.

Sequence Diagram

sequenceDiagram
    participant Route as webhook/route.ts
    participant ProcHist as webhook/process-history.ts
    participant Utils as utils/email/microsoft.ts
    participant Shared as Shared Handler

    Route->>Route: Create scoped logger
    Route->>ProcHist: processHistoryForUser(payload + logger)
    Note over ProcHist: Enhance logger with email context
    ProcHist->>Utils: processHistory(options + logger)
    Note over Utils: Pass logger to processHistoryForUser
    Utils->>Shared: processHistoryForUser(payload + logger)
    Note over Shared: Use logger for structured logging
    Shared-->>Utils: result
    Utils-->>ProcHist: void
    ProcHist-->>Route: void
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Signature changes across multiple files: processHistoryForUser and processHistory now require logger parameter; requires verification that all callsites are updated
  • Logger propagation chain: Trace logger flow from route.ts through process-history.ts to microsoft.ts to ensure proper scoping and context
  • Import path adjustments: Verify import changes from local logger.ts to Logger type from utils/logger are correctly applied
  • Error handling updates: Review enhanced error logging paths and ensure context (subscriptionId, messageId) is properly logged via scoped loggers
  • Removed process-history-item.ts: Confirm delegation to processHistoryItemShared is correctly wired through microsoft.ts

Possibly related PRs

  • Extend logger functionality #331: Introduces Logger type and extends createScopedLogger infrastructure that underpins this logger propagation refactoring
  • Fix outlook webhook #836: Modifies process-history-item.ts to refactor internals; overlaps with removed file in this PR
  • Fix e2e test #904: Updates processHistoryItem flow and logger handling; related to error logging and logger context changes in this PR

Poem

🐰 A logger hops through webhook lanes,
No longer bound by local chains,
Each function passes threads with care,
Context rich, and scope so fair—
The trail now flows where needed most,
From route to route, from post to post! 🌳✨

Pre-merge checks and finishing touches

✅ 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 describes the main change: refactoring how logging is handled in the Outlook webhook system by removing a centralized logger module and propagating logger instances through the call chain.

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
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

Reviewed changes from recent commits (found 1 issue).

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="apps/web/utils/email/microsoft.ts">

<violation number="1" location="apps/web/utils/email/microsoft.ts:1259">
The new logger option is never used; this call still passes the module-level logger instead of the injected `options.logger`, so the caller-provided logging context is lost.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@elie222 elie222 merged commit 566e7c7 into main Nov 5, 2025
5 of 6 checks passed
@elie222 elie222 deleted the chore/outlook-webhook-logger branch November 5, 2025 21:57
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

This was referenced Nov 9, 2025
This was referenced Nov 24, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments