Skip to content

Conversation

@yujonglee
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Jun 17, 2025

📝 Walkthrough

Walkthrough

A new optional field, pre_meeting_memo_html, was added to the Session struct and propagated throughout the Rust backend, database schema, and TypeScript bindings. Supporting code and tests were updated to handle this field. Additionally, a test module for extension schema generation was removed, and some configuration and migration files were updated.

Changes

File(s) Change Summary
.cargo/config.toml Removed explicit MSVC environment variable settings for C/C++ flags.
crates/db-user/src/extensions_types.rs Removed the test module for generating and writing the extension definition JSON schema.
crates/db-user/src/init.rs Refactored session creation to use a helper for defaults; added pre_meeting_memo_html to default session.
crates/db-user/src/lib.rs Added a new migration file (sessions_migration_4.sql) to the migrations array.
crates/db-user/src/sessions_migration_4.sql Added pre_meeting_memo_html TEXT column to the sessions table.
crates/db-user/src/sessions_ops.rs Updated session operations to support pre_meeting_memo_html; updated tests accordingly.
crates/db-user/src/sessions_types.rs Added pre_meeting_memo_html: Option<String> to Session and updated row parsing.
crates/db-user/src/tags_ops.rs Set pre_meeting_memo_html to None in test session setup.
plugins/db/js/bindings.gen.ts Added optional `pre_meeting_memo_html: string
apps/desktop/src/routes/app.new.tsx Added pre_meeting_memo_html: null property when creating or updating sessions via UI.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant JS_Bindings
    participant Rust_Backend
    participant Database

    Client->>JS_Bindings: Create/Update Session (with optional pre_meeting_memo_html)
    JS_Bindings->>Rust_Backend: upsert_session(Session)
    Rust_Backend->>Database: INSERT/UPDATE sessions (including pre_meeting_memo_html)
    Database-->>Rust_Backend: Confirmation/Result
    Rust_Backend-->>JS_Bindings: Session (with pre_meeting_memo_html)
    JS_Bindings-->>Client: Session (with pre_meeting_memo_html)
Loading
sequenceDiagram
    participant Rust_Backend
    participant Database

    Rust_Backend->>Database: ALTER TABLE sessions ADD COLUMN pre_meeting_memo_html TEXT
    Database-->>Rust_Backend: Migration Complete
Loading

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5377c71 and 861d79d.

📒 Files selected for processing (1)
  • apps/desktop/src/routes/app.new.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/desktop/src/routes/app.new.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 1

🔭 Outside diff range comments (1)
crates/db-user/src/tags_ops.rs (1)

80-85: list_session_tags returns wrong result set – missing join with bridge table

tags does not contain session_id; the relationship is modelled via tags_sessions.
Current query silently returns an empty set for every call.

-        let mut rows = conn
-            .query(
-                "SELECT * FROM tags WHERE session_id = ?",
-                vec![session_id.into()],
-            )
+        let mut rows = conn
+            .query(
+                "SELECT t.* \
+                 FROM tags_sessions ts \
+                 JOIN tags t ON t.id = ts.tag_id \
+                 WHERE ts.session_id = ?",
+                vec![session_id.into()],
+            )
🧹 Nitpick comments (4)
crates/db-user/src/lib.rs (1)

131-151: Avoid manual array-length bookkeeping for MIGRATIONS

Every new migration forces an update of the array length literal (18). Switching to a slice eliminates this maintenance step and prevents mismatches.

-// Append only. Do not reorder.
-const MIGRATIONS: [&str; 18] = [
+// Append only. Do not reorder.
+const MIGRATIONS: &[&str] = &[
     include_str!("./calendars_migration.sql"),
@@
     include_str!("./sessions_migration_3.sql"),
     include_str!("./sessions_migration_4.sql"),
 ];

No other code changes are needed – the slice still supports .to_vec().

crates/db-user/src/sessions_ops.rs (2)

19-20: Simplify NULL / empty-string predicate

(pre_meeting_memo_html IS NULL OR pre_meeting_memo_html = '') is correct but verbose.
Using COALESCE keeps the pattern consistent with other predicates and is slightly clearer:

-            (pre_meeting_memo_html IS NULL OR pre_meeting_memo_html = '') AND
+            COALESCE(pre_meeting_memo_html, '') = '' AND

203-205: Manual column duplication makes the UPSERT brittle

Every time a field is added/removed you now have to touch three separate lists (INSERT columns, VALUES, UPDATE set, param map).
This has already bitten us with record_end/pre_meeting_memo_html. A miss will silently insert NULL or fail at runtime.

Consider:

  1. Building the SQL with a helper that joins a single slice of field names.
  2. Or switching to a query-builder/ORM (e.g. sea-query) that derives the lists for you.

Keeps migrations and code in sync and avoids subtle production inconsistencies.
(Not blocking for this PR, but worth a quick backlog ticket.)

Also applies to: 217-218, 232-233, 247-248

crates/db-user/src/init.rs (1)

474-475: Keep new_default_session in sync with Session struct

You added pre_meeting_memo_html: None, which is exactly what we need.
As the struct evolves this helper must always be updated; consider deriving Default on Session and using Session::default() to prevent drift.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af033bf and 5377c71.

📒 Files selected for processing (9)
  • .cargo/config.toml (0 hunks)
  • crates/db-user/src/extensions_types.rs (0 hunks)
  • crates/db-user/src/init.rs (2 hunks)
  • crates/db-user/src/lib.rs (2 hunks)
  • crates/db-user/src/sessions_migration_4.sql (1 hunks)
  • crates/db-user/src/sessions_ops.rs (6 hunks)
  • crates/db-user/src/sessions_types.rs (2 hunks)
  • crates/db-user/src/tags_ops.rs (1 hunks)
  • plugins/db/js/bindings.gen.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • .cargo/config.toml
  • crates/db-user/src/extensions_types.rs
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,rs}`: 1. No error handling. 2. No unused imports, variables, or functions. 3. For comments, keep it minimal. It should be about "Why", not "What".

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

  • crates/db-user/src/tags_ops.rs
  • crates/db-user/src/lib.rs
  • plugins/db/js/bindings.gen.ts
  • crates/db-user/src/sessions_ops.rs
  • crates/db-user/src/sessions_types.rs
  • crates/db-user/src/init.rs
🧬 Code Graph Analysis (2)
plugins/db/js/bindings.gen.ts (1)
plugins/listener/js/bindings.gen.ts (1)
  • Word (77-77)
crates/db-user/src/init.rs (3)
plugins/db/js/bindings.gen.ts (1)
  • Session (159-159)
crates/db-user/src/sessions_ops.rs (1)
  • onboarding_session_id (7-9)
plugins/db/src/commands/sessions.rs (1)
  • onboarding_session_id (4-17)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: ci
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (5)
crates/db-user/src/sessions_migration_4.sql (1)

1-4: Migration looks good – column appended safely

Adding the nullable TEXT column at the tail of the table preserves the positional order of existing columns, so no index offsets are introduced.
No further action needed.

crates/db-user/src/tags_ops.rs (1)

126-126: Test data kept in sync with new struct field

Setting pre_meeting_memo_html: None keeps the test compilation-safe after the struct change. 👍

plugins/db/js/bindings.gen.ts (1)

159-160: Generated bindings correctly propagated – no action

The new optional field is present and typed as string | null. Looks consistent with the Rust definition.

crates/db-user/src/sessions_ops.rs (1)

401-404: 👍 Assertion for the new field looks good

The additional test ensures round-tripping of pre_meeting_memo_html; coverage for the new column is now in place.

crates/db-user/src/init.rs (1)

67-68: Nice reduction of boilerplate with new_default_session

Replacing the hand-written field list with struct-update syntax keeps the onboarding logic concise and future-proof.

Also applies to: 75-76

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