Skip to content

Updated conversation_id permission in project user for report notifications#150

Merged
ussaama merged 1 commit intomainfrom
report-notifications-conversation-permission-update
May 15, 2025
Merged

Updated conversation_id permission in project user for report notifications#150
ussaama merged 1 commit intomainfrom
report-notifications-conversation-permission-update

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented May 15, 2025

  • Added new fields and relations for conversation_id in permissions.json to improve data integrity.
  • Updated GraphQL and OpenAPI specifications to include new queries and mutations for managing aspects and conversations.
  • Introduced new input types and filters for aspects, enhancing the API's functionality.
  • Improved subscription events to include changes related to aspects and conversations, ensuring real-time updates.
  • Refactored existing queries and mutations for better organization and clarity.

Summary by CodeRabbit

  • New Features

    • Introduced new GraphQL queries, mutations, and subscriptions for managing aspects, projects, conversations, conversation segments, and notification participants.
    • Added new fields to projects, conversations, and quotes for enhanced audio processing, notification subscription, conversation completion status, and quote embeddings.
  • Improvements

    • Updated permissions to allow access to the conversation ID in notification participant records.
    • Reorganized and expanded GraphQL schema for better structure and additional capabilities.

- Added new fields and relations for `conversation_id` in permissions.json to improve data integrity.
- Updated GraphQL and OpenAPI specifications to include new queries and mutations for managing aspects and conversations.
- Introduced new input types and filters for aspects, enhancing the API's functionality.
- Improved subscription events to include changes related to aspects and conversations, ensuring real-time updates.
- Refactored existing queries and mutations for better organization and clarity.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 15, 2025

Walkthrough

This change updates permissions to include the conversation_id field for the project_report_notification_participants collection and reorganizes the GraphQL schema. It adds or reorders fields and operations for entities such as aspect, project, conversation, conversation_segment, project_report_notification_participants, and quote, reflecting new fields and input types.

Changes

File(s) Change Summary
echo/directus/sync/collections/permissions.json Added conversation_id to the fields array for create, read, and update permissions on the project_report_notification_participants collection.
echo/directus/sync/specs/item.graphql,
echo/directus/sync/specs/system.graphql
Major reordering and extension of the GraphQL schema: introduced or reordered entities (aspect, project, conversation, conversation_segment, project_report_notification_participants); added queries, mutations, and subscriptions for these entities; moved and added fields such as is_finished, embedding, is_enhanced_audio_processing_enabled, and is_project_notification_subscription_allowed in types and input objects; removed duplicate declarations and cleaned up schema structure.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant GraphQL_API
  participant DB

  Client->>GraphQL_API: create_project_report_notification_participants (with conversation_id)
  GraphQL_API->>DB: Insert project_report_notification_participants (conversation_id included)
  DB-->>GraphQL_API: Confirmation/Result
  GraphQL_API-->>Client: Response with new participant (including conversation_id)

  Client->>GraphQL_API: query project_report_notification_participants (fields include conversation_id)
  GraphQL_API->>DB: Select project_report_notification_participants (conversation_id included)
  DB-->>GraphQL_API: Data rows (with conversation_id)
  GraphQL_API-->>Client: Response (with conversation_id field)
Loading

Possibly related PRs

Suggested labels

Feature

Suggested reviewers

  • spashii

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb74543 and f1e4f5e.

📒 Files selected for processing (3)
  • echo/directus/sync/collections/permissions.json (3 hunks)
  • echo/directus/sync/specs/item.graphql (28 hunks)
  • echo/directus/sync/specs/system.graphql (14 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci-check-server
🔇 Additional comments (59)
echo/directus/sync/collections/permissions.json (3)

3112-3113: LGTM on granting conversation_id (and email_opt_in) on create
Great call to include conversation_id in the create fields so notifications can be tied to their conversation. I also notice email_opt_in was added—please verify this matches the GraphQL input type for project_report_notification_participants.


3131-3132: LGTM on exposing date_updated & conversation_id on read
Allowing clients to read both date_updated and conversation_id aligns perfectly with the updated schema and boosts traceability of notification records.


3160-3161: Review update permissions for date_updated & conversation_id
Including conversation_id in update operations is spot-on, but exposing date_updated here lets clients override the system timestamp, which could break audit integrity. Should we remove date_updated from the updatable fields?

echo/directus/sync/specs/system.graphql (15)

265-265: Subscription: Add aspect_mutated event
LGTM – this brings the aspect subscription in line with new mutations. Great for real-time updates!


270-271: Subscription: Add project_mutated & conversation_mutated events
Solid addition. Enables live push for projects and conversations. Love it!


288-289: Subscription: Add project_report_notification_participants_mutated & quote_mutated events
Perfect—now subscribers will catch both report-participant and quote updates instantly.


291-291: Subscription: Add conversation_segment_mutated event
Good catch—this completes the set of conversation segment subscriptions.


437-437: Schema: Add is_finished: Boolean to conversation type
LGTM—explicitly marking finished conversations is a smart move for clarity in queries.


2366-2366: Filter: Add is_finished to conversation_filter
Nice complement to the new field—filtering on finished state is now available.


1905-1908: Schema: Add project subscription settings to project type
Introducing is_enhanced_audio_processing_enabled and is_project_notification_subscription_allowed aligns with new features—looks solid.


2496-2496: Input: Add is_finished to create_conversation_input
Good to allow setting finished state on creation. LGTM!


2958-2960: Input: Add audio & notification flags to create_project_input
is_enhanced_audio_processing_enabled & is_project_notification_subscription_allowed in creation input—perfect match.


2139-2139: Schema: Add embedding: String to quote type
Embedding field is crucial for vector search—nice addition!


3014-3015: Input: Add embedding to create_quote_input
Now clients can supply embeddings at creation time—great extension.


3769-3769: Filter: Add embedding to quote_filter
Enables filtering by embedding—super useful for similarity queries.


3863-3863: Input: Add is_finished to update_conversation_input
Makes updating the finished flag possible—LGTM.


4365-4367: Input: Add audio & notification flags to update_project_input
Mirrors create input perfectly. Consistent and ready for updates.


4422-4422: Input: Add embedding to update_quote_input
Allows patching embeddings post-creation—excellent touch.

echo/directus/sync/specs/item.graphql (41)

6-9: Consistent Addition of Aspect Queries LGTM. These aspect queries align with existing patterns. Ensure corresponding resolvers and data sources are updated.


22-25: Consistent Addition of Project Queries LGTM. The project queries mirror the existing CRUD patterns. Confirm backend support for versioned queries.


26-29: Addition of Conversation Queries LGTM. The conversation queries are in line with the schema structure. Ensure conversation_filter supports the new is_finished field.


94-97: Addition of project_report_notification_participants Queries LGTM. New queries for project_report_notification_participants are correctly defined. Verify permissions update to expose conversation_id.


106-109: Addition of conversation_segment Queries LGTM. These new fields follow existing naming conventions. Confirm resolvers and data integrity for segments.


123-124: Addition of Aspect Mutations (create) LGTM. The create_aspect mutations align with the standard create patterns. Ensure input validation and permission checks for nested fields.


131-132: Addition of Project Mutations (create) LGTM. New create_project mutations match existing structure. Verify default values for new Boolean fields in input.


133-134: Addition of Conversation Mutations (create) LGTM. The new mutations follow precedent. Ensure is_finished value is handled correctly in resolvers.


167-168: Addition of project_report_notification_participants Mutations (create) LGTM. These match CRUD naming. Check you’ve updated permission scopes for nested conversation_id input.


169-170: Addition of Quote Mutations (create) LGTM. The create_quote operations align well. Ensure embedding is optional or required per business logic.


173-174: Addition of conversation_segment Mutations (create) LGTM. Follows existing create patterns. Confirm config_id and lightrag_flag defaults in nested creation.


182-184: Addition of Aspect Mutations (update) LGTM. The update_aspect operations are consistent. Ensure partial updates respect nested relations.


194-196: Addition of Project Mutations (update) LGTM. New update_project operations correctly defined. Validate new flags in update input.


197-199: Addition of Conversation Mutations (update) LGTM. update_conversation operations added. Ensure is_finished boolean updates are idempotent.


248-250: Addition of project_report_notification_participants Mutations (update) LGTM. Structure matches existing update patterns. Double-check filters include conversation_id.


251-253: Addition of Quote Mutations (update) LGTM. The update_quote mutations support embedding updates. Verify input validation on embedding.


257-259: Addition of conversation_segment Mutations (update) LGTM. Nested update semantics are preserved. Ensure bulk update respects segment relationships.


268-269: Addition of Aspect Mutations (delete) LGTM. Delete operations for aspect are defined. Confirm cascade or restriction behaviors on related objects.


276-277: Addition of Project Mutations (delete) LGTM. delete_project ops added. Ensure soft-delete or archival workflows remain consistent.


278-279: Addition of Conversation Mutations (delete) LGTM. Delete queries for conversations conform. Verify triggers for cleanup of related segments.


312-313: Addition of project_report_notification_participants Mutations (delete) LGTM. Delete operations in line with others. Ensure permissions allow deletion by owners.


314-315: Addition of Quote Mutations (delete) LGTM. Delete operations for quotes implemented. Confirm removal of orphaned relations.


318-319: Addition of conversation_segment Mutations (delete) LGTM. Ensure deletion handles segment-chunk linkage cleanup.


348-348: Addition of aspect_mutated Subscription LGTM. Subscription event for aspect follows naming. Confirm client-side handlers are updated.


353-354: Addition of project_mutated and conversation_mutated Subscriptions LGTM. Subscription events added correctly. Verify event payloads include new fields.


371-372: Addition of project_report_notification_participants_mutated and quote_mutated Subscriptions LGTM. Subscriptions for notifications and quote changes are aligned. Ensure permission checks for subscription channel.


374-374: Addition of conversation_segment_mutated Subscription LGTM. Confirm subscription emits correct mutation events for segment updates.


546-546: Addition of is_finished Field to conversation Type LGTM. This Boolean completes the conversation lifecycle model. Ensure field is populated in resolver.


595-595: Addition of is_finished to conversation_aggregated_count LGTM. Aggregation count now tracks is_finished. Check integration with analytics queries.


2269-2269: Addition of is_finished to version_conversation Type LGTM. Versioned schema now includes is_finished. Confirm backward compatibility in version fetching.


2866-2866: Addition of is_finished to create_conversation_input LGTM. Input supports new lifecycle flag. Add default handling if omitted.


3958-3958: Addition of is_finished to update_conversation_input LGTM. Update input covers new flag. Ensure resolver applies default logic when absent.


1533-1536: Addition of New Boolean Flags to project Type LGTM. is_enhanced_audio_processing_enabled and is_project_notification_subscription_allowed enhance project configuration. Ensure database schema updated and resolvers return correct defaults.


1579-1582: Addition of New Flags to project_aggregated_count LGTM. Aggregated counts for new flags included. Validate analytics pipelines incorporate these metrics.


3162-3165: Addition of New Boolean Flags to create_project_input LGTM. Inputs now allow audio and notification flags. Confirm validation enforces non-null where required.


4254-4257: Addition of New Boolean Flags to update_project_input LGTM. Flags align with create input. Ensure patch operations handle both flags correctly.


2068-2068: Addition of embedding Field to quote Type LGTM. Embedding supports downstream ML workloads. Make sure resolver populates this field efficiently.


2102-2102: Addition of embedding to quote_aggregated_count LGTM. Aggregation now includes embedding count. Verify this aligns with analytics expectations.


3240-3240: Addition of embedding to create_quote_input LGTM. Input now captures embedding. Confirm validation and storage match expected binary/JSON format.


3864-3864: Addition of embedding to quote_filter LGTM. Filter allows querying on embedding string. Check backend supports filter operations on embeddings.


4332-4332: Addition of embedding to update_quote_input LGTM. Update input covers embedding. Ensure patch logic clears or overwrites correctly.


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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@coderabbitai coderabbitai bot requested a review from spashii May 15, 2025 08:24
@coderabbitai coderabbitai bot added the Feature label May 15, 2025
@ussaama ussaama enabled auto-merge May 15, 2025 08:28
@ussaama ussaama added this pull request to the merge queue May 15, 2025
Merged via the queue into main with commit b43447e May 15, 2025
6 checks passed
spashii pushed a commit that referenced this pull request Nov 18, 2025
…ations (#150)

Enhance Directus schema and API for aspect and conversation management

- Added new fields and relations for `conversation_id` in permissions.json to improve data integrity.
- Updated GraphQL and OpenAPI specifications to include new queries and mutations for managing aspects and conversations.
- Introduced new input types and filters for aspects, enhancing the API's functionality.
- Improved subscription events to include changes related to aspects and conversations, ensuring real-time updates.
- Refactored existing queries and mutations for better organization and clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants