Skip to content

fix(server): share query - #15305

Merged
darkskygit merged 1 commit into
canaryfrom
darksky/fix-share-query
Jul 21, 2026
Merged

fix(server): share query#15305
darkskygit merged 1 commit into
canaryfrom
darksky/fix-share-query

Conversation

@darkskygit

@darkskygit darkskygit commented Jul 21, 2026

Copy link
Copy Markdown
Member

fix #15283

PR Dependency Tree

This tree was auto-generated by Charcoal

Summary by CodeRabbit

  • Bug Fixes
    • Document metadata now consistently reports documents as not public when no applicable access policy is available.
    • Improved reliability of document visibility information across document listings and pagination.
  • Tests
    • Added coverage verifying the public status in document details and paginated results.

@coderabbitai

coderabbitai Bot commented Jul 21, 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: 2bb1da22-fcf4-4e5e-aa3c-648aeddb28c5

📥 Commits

Reviewing files that changed from the base of the PR and between 7318ef1 and 1ee1004.

📒 Files selected for processing (2)
  • packages/backend/server/src/__tests__/models/doc.spec.ts
  • packages/backend/server/src/models/doc.ts

📝 Walkthrough

Walkthrough

Document metadata queries now normalize missing access-policy data to public: false. Tests verify this behavior for direct document info retrieval and both initial and cursor-based pagination results.

Changes

Document public metadata

Layer / File(s) Summary
Normalize public flag in document queries
packages/backend/server/src/models/doc.ts, packages/backend/server/src/__tests__/models/doc.spec.ts
The three document query methods use COALESCE to return false when access-policy values are missing or null; tests assert public: false for direct and paginated results.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the fix, but "share query" is too vague to describe the actual change. Use a more specific title, such as mentioning the doc public-flag fallback in the share query.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The COALESCE change fixes newly created docs returning null public values while preserving existing shared-doc behavior.
Out of Scope Changes check ✅ Passed The changes stay focused on the share-query/public-flag fix and matching tests, with no unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying blocksuite-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1ee1004
Status: ✅  Deploy successful!
Preview URL: https://df02fc6f.blocksuite-docs.pages.dev
Branch Preview URL: https://darksky-fix-share-query.blocksuite-docs.pages.dev

View logs

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.68%. Comparing base (7318ef1) to head (1ee1004).
⚠️ Report is 1 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #15305      +/-   ##
==========================================
- Coverage   60.72%   60.68%   -0.05%     
==========================================
  Files        3311     3311              
  Lines      191936   191945       +9     
  Branches    28277    28272       -5     
==========================================
- Hits       116548   116475      -73     
- Misses      71600    71673      +73     
- Partials     3788     3797       +9     
Flag Coverage Δ
server-test 80.58% <100.00%> (-0.11%) ⬇️
unittest 35.82% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@darkskygit
darkskygit merged commit d0781ea into canary Jul 21, 2026
64 of 66 checks passed
@darkskygit
darkskygit deleted the darksky/fix-share-query branch July 21, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:server test Related to test cases

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Bug]: Share button won't work

1 participant