Skip to content

refactor(platform): promote folderPath to top-level documents field#1106

Merged
yannickmonney merged 1 commit into
mainfrom
refactor/documents-folder-path-field
Apr 7, 2026
Merged

refactor(platform): promote folderPath to top-level documents field#1106
yannickmonney merged 1 commit into
mainfrom
refactor/documents-folder-path-field

Conversation

@yannickmonney
Copy link
Copy Markdown
Contributor

Summary

  • Add folderPath as optional top-level field on documents schema with org+folderPath composite index
  • Compute and store folderPath on document create and update (from folder hierarchy)
  • Agent listing prefers stored folderPath, falls back to breadcrumb resolution for un-backfilled docs
  • Add idempotent backfill migration for existing documents
  • Backwards compatible — field is optional, existing documents continue to work

Fixes #703

Add folderPath as an indexed top-level field on the documents table to
enable index-based folder filtering instead of full-table scans.

- Add folderPath field and by_organizationId_and_folderPath index to schema
- Compute folderPath from folder hierarchy on document create and update
- Prefer stored folderPath in agent listing response, fall back to breadcrumb
- Add backfill migration for existing documents with folderId
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Warning

Rate limit exceeded

@yannickmonney has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b3b17338-12ab-469a-9e5a-4ee6df5e7546

📥 Commits

Reviewing files that changed from the base of the PR and between cc3bbbf and 66766c9.

⛔ Files ignored due to path filters (1)
  • services/platform/convex/migrations/backfill_folder_path.ts is excluded by !**/migrations/**
📒 Files selected for processing (7)
  • services/platform/convex/documents/create_document.ts
  • services/platform/convex/documents/list_documents_for_agent.ts
  • services/platform/convex/documents/schema.ts
  • services/platform/convex/documents/types.ts
  • services/platform/convex/documents/update_document_internal.ts
  • services/platform/convex/documents/validators.ts
  • services/platform/convex/folders/queries.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/documents-folder-path-field

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.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@yannickmonney yannickmonney merged commit ae05fdb into main Apr 7, 2026
19 of 24 checks passed
@yannickmonney yannickmonney deleted the refactor/documents-folder-path-field branch April 7, 2026 22:50
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.

refactor(platform): Promote folderPath to top-level documents schema field

1 participant