feat: implement message type/name persistence, rehydration and calendar date fixes#732
Conversation
…ar date fixes Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
📜 Recent review details🧰 Additional context used🪛 ast-grep (0.44.1)public/sw.js[warning] Avoid using the initial state variable in setState (setstate-same-var) 🔇 Additional comments (19)
WalkthroughChat message metadata now persists through the database and rehydrates into UI state, synthetic and unsupported messages are filtered, public chat lookup accepts missing users, calendar date queries use typed comparisons, error logs gain context, tests cover these paths, and service-worker assets are refreshed. ChangesChat message persistence and rehydration
Calendar note querying and diagnostics
Service-worker assets
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AIState
participant saveChat
participant MessagesDB
participant SearchPage
AIState->>saveChat: persist filtered messages with type and name
saveChat->>MessagesDB: insert or upsert message metadata
SearchPage->>MessagesDB: load chat messages
MessagesDB-->>SearchPage: return content, role, type, and name
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 |
|
|
||
| // Mock getCurrentUserIdOnServer | ||
| const originalGetCurrentUserIdOnServer = auth.getCurrentUserIdOnServer; | ||
| auth.getCurrentUserIdOnServer = async () => dummyUserId; |
There was a problem hiding this comment.
auth is an ESM namespace import, so this binding is read-only: TypeScript reports an assignment-to-read-only-import error and Bun/ESM will throw when the test module is evaluated. Since tsconfig.json includes every **/*.ts, the PR build/typecheck will fail before these tests can run. Use Bun's module mocking mechanism (or dependency injection) instead of assigning to the imported namespace.
| // For instance, if a message with role 'tool' should have a 'name', | ||
| // or if some messages have a specific 'type' based on content or other flags. | ||
| // This mapping assumes standard user/assistant messages primarily. | ||
| type: dbMsg.type ? (dbMsg.type as AIMessage['type']) : undefined, |
There was a problem hiding this comment.
All existing messages rows get NULL for these newly added columns, and this migration neither backfills them nor derives legacy discriminators during rehydration. getUIStateFromAIState drops every message whose type is falsy, so opening any chat saved before this deployment produces an empty UI. Add a backward-compatible derivation/backfill before relying on dbMsg.type here.
This pull request implements the persistence of
typeandnamemessage discriminators, full rehydration ofAIMessageobjects, fixes anonymous retrieval defects, and solves the driver-level Date-vs-string parameter mismatch in calendar queries.PR created automatically by Jules for task 11147334533270605937 started by @ngoiyaeric
Summary by CodeRabbit