Skip to content

Message dates admin#1005

Merged
elie222 merged 1 commit intomainfrom
chore/logs
Nov 24, 2025
Merged

Message dates admin#1005
elie222 merged 1 commit intomainfrom
chore/logs

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 24, 2025

Show message dates in the admin Gmail URL converter and modify adminConvertGmailUrlAction to return message objects with internalDate

Update the admin Gmail URL converter UI to render per-message id and formatted date, and change the admin action response to { threadId, messages, rfc822MessageId } with messages containing id and internalDate. Add info logs when non-inbox/sent messages are skipped during history processing. Bump version to v2.20.21.

📍Where to Start

Start with the adminConvertGmailUrlAction response changes in admin.ts, then review the rendering in GmailUrlConverter.tsx.


Macroscope summarized c7b663b.

Summary by CodeRabbit

  • New Features

    • Admin interface now displays message dates alongside message IDs for improved visibility and tracking.
  • Chores

    • Version bumped to v2.20.21.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 24, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Building Building Preview Nov 24, 2025 2:04pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Walkthrough

The changes enhance the Gmail URL converter feature to include message dates in addition to IDs. The admin action now returns enriched message metadata with internalDate, the UI component renders individual messages with formatted dates instead of a comma-joined ID list, and logging is added to the webhook to track filtered messages.

Changes

Cohort / File(s) Summary
Gmail Message Date Enrichment
apps/web/utils/actions/admin.ts, apps/web/app/(app)/admin/GmailUrlConverter.tsx
Return payload restructured to include per-message dates. Action now maps internalDate to date field, and UI iterates over messages array displaying both id and formatted date instead of comma-joined messageIds string.
Webhook Message Filtering
apps/web/app/api/google/webhook/process-history.ts
Added logging side-effect to inbox/sent message filter; logs skipped messages with messageId and labelIds for debugging purposes.
Version Bump
version.txt
Version incremented from v2.20.20 to v2.20.21.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Data structure modifications are straightforward and consistent across related files
  • Logging addition in webhook is a minor, non-breaking change
  • No complex logic or control flow restructuring

Possibly related PRs

Poem

A rabbit hops through dates so fine,
Each message tagged with when it signed,
No more just IDs in a line—
Now dates and details intertwined! 🐰📅

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 'Message dates admin' directly relates to the main changes: adding date metadata to messages in the admin interface and updating the data structure from messageIds to messages with date information.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/logs

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.

@elie222 elie222 merged commit 64c2576 into main Nov 24, 2025
13 of 15 checks passed
Copy link
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: 0

🧹 Nitpick comments (1)
apps/web/app/(app)/admin/GmailUrlConverter.tsx (1)

94-106: LGTM - Clean implementation with proper null handling.

The message rendering correctly handles optional dates and formats them appropriately. The conditional rendering msg.date && ensures internalDateToDate is only called when dates are available.

Optional: For admin consistency, consider using a fixed date format instead of locale-specific:

-                      ({internalDateToDate(msg.date).toLocaleString()})
+                      ({internalDateToDate(msg.date).toISOString()})

This makes dates more predictable for administrative tasks and logs, though the current approach is also reasonable.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf23c21 and c7b663b.

📒 Files selected for processing (4)
  • apps/web/app/(app)/admin/GmailUrlConverter.tsx (2 hunks)
  • apps/web/app/api/google/webhook/process-history.ts (1 hunks)
  • apps/web/utils/actions/admin.ts (1 hunks)
  • version.txt (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/app/(app)/admin/GmailUrlConverter.tsx (1)
apps/web/utils/date.ts (1)
  • internalDateToDate (59-71)
⏰ 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: cubic · AI code reviewer
  • GitHub Check: Review for correctness
  • GitHub Check: test
🔇 Additional comments (4)
version.txt (1)

1-1: LGTM - Standard version increment.

Version bump appropriately reflects the feature enhancement in this PR.

apps/web/app/api/google/webhook/process-history.ts (1)

165-174: LGTM - Good observability improvement.

The added logging helps track which messages are being filtered out and why, without changing the filtering behavior. This will be useful for debugging message processing issues.

apps/web/app/(app)/admin/GmailUrlConverter.tsx (1)

22-22: LGTM - Appropriate utility import.

The internalDateToDate utility correctly handles Gmail's internal date format.

apps/web/utils/actions/admin.ts (1)

251-260: LGTM - Well-structured data enrichment.

The transformation from a simple messageIds array to a richer messages structure is implemented correctly:

  • Optional chaining handles undefined thread.messages
  • Empty array fallback ensures safe iteration
  • Explicit null handling for missing dates (m.internalDate || null)
  • Breaking change is safe since the consuming component is updated in the same PR

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 4 files

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