Skip to content

Fix: remove duplicate document preview access check - #15625

Merged
wangq8 merged 4 commits into
infiniflow:mainfrom
buua436:b062
Jun 4, 2026
Merged

wangq8 merged 4 commits into
infiniflow:mainfrom
buua436:b062

Conversation

@buua436

@buua436 buua436 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

remove duplicate document preview access check

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@coderabbitai

coderabbitai Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b3bd69e5-76df-4a08-94cf-9f35cc236fda

📥 Commits

Reviewing files that changed from the base of the PR and between bbacb31 and d67f551.

📒 Files selected for processing (2)
  • api/apps/restful_apis/document_api.py
  • test/unit_test/api/apps/restful_apis/test_document_preview_accessible.py
💤 Files with no reviewable changes (2)
  • test/unit_test/api/apps/restful_apis/test_document_preview_accessible.py
  • api/apps/restful_apis/document_api.py

📝 Walkthrough

Walkthrough

The /documents/<doc_id>/preview handler's access-denied response path was simplified by removing warning logs and explanatory comments, while preserving the identical error response returned on denial.

Changes

Document preview access simplification

Layer / File(s) Summary
Simplify access-denied response handling
api/apps/restful_apis/document_api.py
The get(doc_id) handler's denied-access branch removes logging and inline comments while maintaining the same "Document not found!" error response shape.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • infiniflow/ragflow#15508: Both PRs modify the /documents/<doc_id>/preview handler's cross-tenant denial path (the retrieved PR reintroduces DocumentService.accessible and its warning, while the main PR simplifies/removes the denied-branch warning logic).
  • infiniflow/ragflow#15505: Directly connected to changes in the same /documents/<doc_id>/preview get handler's authorization gate that leads to the simplified access-denied branch.
  • infiniflow/ragflow#15366: Modifies the same /documents/<doc_id>/preview GET handler in api/apps/restful_apis/document_api.py alongside other storage validation changes.

Suggested labels

🐞 bug

Suggested reviewers

  • wangq8

Poem

🐰 A simpler path emerges,
Log lines fade away,
Comments shed like winter fur,
Same response stays—
Clean and swift today. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing a duplicate document preview access check, which aligns with the modifications in both the API handler and test file.
Description check ✅ Passed The description covers both required template sections: identifies the problem (removing duplicate access check) and marks it as a bug fix. However, it lacks substantive detail beyond the title.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.


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.

@buua436 buua436 added the ci Continue Integration label Jun 4, 2026
@buua436
buua436 marked this pull request as ready for review June 4, 2026 02:09
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 4, 2026
@buua436
buua436 marked this pull request as draft June 4, 2026 02:17
@buua436
buua436 marked this pull request as ready for review June 4, 2026 02:17
@dosubot dosubot Bot added the 🐞 bug Something isn't working, pull request that fix bug. label Jun 4, 2026
@wangq8
wangq8 merged commit c70f19e into infiniflow:main Jun 4, 2026
1 check failed
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (67c3e73) to head (681387c).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15625   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Lobster-0429 added a commit to Lobster-0429/ragflow that referenced this pull request Jun 4, 2026
Take main's infiniflow#15625 fix for the duplicate /preview accessible() check and
its deletion of test_document_preview_accessible.py; this supersedes the
equivalent fixes previously carried on this branch. Branch now contributes
only the Highspot connector files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants