Skip to content

fix(ipc): allow attachment date metadata#1547

Merged
zerob13 merged 1 commit intodevfrom
fix/ipc-attachment-date-metadata
Apr 27, 2026
Merged

fix(ipc): allow attachment date metadata#1547
zerob13 merged 1 commit intodevfrom
fix/ipc-attachment-date-metadata

Conversation

@yyhhyyyyyy
Copy link
Copy Markdown
Collaborator

@yyhhyyyyyy yyhhyyyyyy commented Apr 27, 2026

fix(ipc): allow attachment date metadata

Summary by CodeRabbit

  • New Features

    • File metadata now supports date values for tracking file creation and modification timestamps.
  • Bug Fixes

    • Improved error propagation in session creation and message sending operations to properly notify callers of failures.
  • Tests

    • Added tests for date-based file metadata handling and error handling in session and messaging workflows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Functions createSession and sendMessage now throw errors after updating state. File metadata schemas expanded to support Date objects. Schema definitions centralized and test coverage added for error handling and date metadata validation.

Changes

Cohort / File(s) Summary
Error Propagation in Session Store
src/renderer/src/stores/ui/session.ts
createSession and sendMessage now throw caught errors after updating error.value, enabling callers to observe failures via exceptions rather than silently returning.
File Metadata Schema Enhancement
src/shared/contracts/common.ts, src/shared/contracts/domainSchemas.ts
New FileMetadataValueSchema allows metadata values to be either JSON types or Date objects. MessageFileSchema.metadata and PreparedMessageFileSchema.metadata updated to use this expanded schema, with the definition centralized in common.ts.
Error Handling Test Coverage
test/renderer/components/NewThreadPage.test.ts
Added tests verifying that rejected sendMessage and createSession calls preserve input state (message, attachedFiles) without clearing them on failure.
Contract Schema Test Coverage
test/main/routes/contracts.test.ts
Added test verifying that session creation and chat message route contract schemas accept attachment metadata containing Date objects for fileCreated and fileModified.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit rejoices,
Errors now surface and shout,
Dates bloom in metadata,
Tests catch what might break—
Schemas dance forward, no doubt!

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: allowing Date objects in attachment metadata schemas across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ipc-attachment-date-metadata

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.

@zerob13 zerob13 merged commit 50098a3 into dev Apr 27, 2026
2 of 3 checks passed
@zerob13 zerob13 mentioned this pull request Apr 27, 2026
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.

2 participants