Skip to content

πŸ”’οΈ(backend) bind comment thread to the path document on creation - #2838

Merged
lunika merged 1 commit into
mainfrom
fix/thread-check
Oct 16, 2026
Merged

lunika merged 1 commit into
mainfrom
fix/thread-check

Conversation

@lunika

@lunika lunika commented Oct 14, 2026

Copy link
Copy Markdown
Member

Purpose

Bind the thread to the document named in the URL path: a comment must never be stored in a thread that belongs to another document, even when the caller is allowed to comment on that other document.

Proposal

  • πŸ”’οΈ(backend) bind comment thread to the path document on creation

@lunika lunika self-assigned this Oct 14, 2026
@lunika lunika added the bug Something isn't working label Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack β†’

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

βš™οΈ Run configuration
  • Configuration used: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 89146426-f37a-488d-937d-4f761b3a2b7b
πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between ca88fb0 and fd19c79.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • πŸ” Trigger review

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration
  • Configuration used: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bf0c8371-5859-4e74-bedc-7e151f24e5a1
πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 8c622bb and ca88fb0.

πŸ“’ Files selected for processing: 3
  • CHANGELOG.md
  • src/backend/core/api/serializers.py
  • src/backend/core/tests/documents/test_api_documents_comments.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Comment creation now checks that the requested thread belongs to the document in the request path. If no matching thread exists, validation returns an error for thread_id. Regression tests cover mismatched and nonexistent thread IDs, anonymous requests, and a reader using another document’s URL.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: antolc

Merge Risk: βšͺ Minimal Β· up to ca88f

No actionable merge-blocking issue is established for this change; it is ready for normal merge checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description clearly states that comment threads must bind to the document in the URL path and identifies the security issue addressed by the changes.
Title check Passed The title clearly and concisely identifies the primary change: binding backend comment threads to the path document during creation.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 …
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
πŸ“ Generate docstrings
  • Commit to this branch
  • Create a new PR
πŸ§ͺ Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@lunika
lunika requested a review from kernicPanel October 14, 2026 14:16
Comment thread src/backend/core/api/serializers.py Resolved
@lunika
lunika force-pushed the fix/thread-check branch 3 times, most recently from 12ed2c3 to ca88fb0 Compare October 16, 2026 14:00
@lunika
lunika enabled auto-merge (squash) October 16, 2026 14:00
Bind the thread to the document named in the URL path: a comment must
never be stored in a thread that belongs to another document, even when
the caller is allowed to comment on that other document.
@lunika
lunika merged commit 43f9748 into main Oct 16, 2026
50 checks passed
@lunika
lunika deleted the fix/thread-check branch October 16, 2026 15:04
lunika added a commit that referenced this pull request Oct 21, 2026
Added

- ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552
- 🌐(frontend) add Crowdin translator context #2785
- ✨(frontend) open the emoji picker when adding a document emoji #2777

Changed

- πŸ’„(frontend) limit heading choices to levels 1–3

- ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775
- πŸ’„(frontend) update upload loader and error ui #2778
- ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853
- ♿️(frontend) allow opening the home button in a new tab #2839
- πŸ’„(frontend) use 12px for error page home links #2809

Fixed

- πŸ›(frontend) don't add a reader's duplicate to the doc tree #2860
- πŸ›(frontend) fix confirmation modal for duplicating sub-docs #2860
- πŸ›(frontend) wrap long unbroken document titles #2852
- πŸ›(frontend) wrap long text in the print export #2813
- πŸ”’οΈ(backend) bind comment thread to the path document on creation #2838
- πŸ›(frontend) fix search highlight hidden inside code blocks #2681
- πŸ”’οΈ(backend) require present document access for thread and comment
  writes #2840
- πŸ›(backend) enforce resource server action restrictions on the external
  API #2745
- πŸ›(backend) mark only the top duplicate as a copy, after its title #2855
- πŸ›(yhub) measure migration durations with a monotonic clock #2814
- πŸ›(backend) send the mention email when the cache is unreachable #2803
- πŸ›(backend) give media-auth its own throttle scope
- πŸ’„(frontend) remove the vertical line next to nested blocks #2825
lunika added a commit that referenced this pull request Oct 21, 2026
Added

- ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552
- 🌐(frontend) add Crowdin translator context #2785
- ✨(frontend) open the emoji picker when adding a document emoji #2777

Changed

- πŸ’„(frontend) limit heading choices to levels 1–3

- ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775
- πŸ’„(frontend) update upload loader and error ui #2778
- ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853
- ♿️(frontend) allow opening the home button in a new tab #2839
- πŸ’„(frontend) use 12px for error page home links #2809

Fixed

- πŸ›(frontend) don't add a reader's duplicate to the doc tree #2860
- πŸ›(frontend) fix confirmation modal for duplicating sub-docs #2860
- πŸ›(frontend) wrap long unbroken document titles #2852
- πŸ›(frontend) wrap long text in the print export #2813
- πŸ”’οΈ(backend) bind comment thread to the path document on creation #2838
- πŸ›(frontend) fix search highlight hidden inside code blocks #2681
- πŸ”’οΈ(backend) require present document access for thread and comment
  writes #2840
- πŸ›(backend) enforce resource server action restrictions on the external
  API #2745
- πŸ›(backend) mark only the top duplicate as a copy, after its title #2855
- πŸ›(yhub) measure migration durations with a monotonic clock #2814
- πŸ›(backend) send the mention email when the cache is unreachable #2803
- πŸ›(backend) give media-auth its own throttle scope
- πŸ’„(frontend) remove the vertical line next to nested blocks #2825
lunika added a commit that referenced this pull request Oct 21, 2026
Added

- ✨(docspec) handle DocSpec 4xx/5xx import errors distinctly #2552
- 🌐(frontend) add Crowdin translator context #2785
- ✨(frontend) open the emoji picker when adding a document emoji #2777

Changed

- πŸ’„(frontend) limit heading choices to levels 1–3

- ♻️(frontend) replace outdated AGPL mentions of BlockNote XL packages #2775
- πŸ’„(frontend) update upload loader and error ui #2778
- ⬆️(yhub) upgrade @y/hub to 0.10.1 #2853
- ♿️(frontend) allow opening the home button in a new tab #2839
- πŸ’„(frontend) use 12px for error page home links #2809

Fixed

- πŸ›(frontend) don't add a reader's duplicate to the doc tree #2860
- πŸ›(frontend) fix confirmation modal for duplicating sub-docs #2860
- πŸ›(frontend) wrap long unbroken document titles #2852
- πŸ›(frontend) wrap long text in the print export #2813
- πŸ”’οΈ(backend) bind comment thread to the path document on creation #2838
- πŸ›(frontend) fix search highlight hidden inside code blocks #2681
- πŸ”’οΈ(backend) require present document access for thread and comment
  writes #2840
- πŸ›(backend) enforce resource server action restrictions on the external
  API #2745
- πŸ›(backend) mark only the top duplicate as a copy, after its title #2855
- πŸ›(yhub) measure migration durations with a monotonic clock #2814
- πŸ›(backend) send the mention email when the cache is unreachable #2803
- πŸ›(backend) give media-auth its own throttle scope
- πŸ’„(frontend) remove the vertical line next to nested blocks #2825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants