Skip to content

fix(api): restore Service API file document writes - #44972

Merged
FFXN merged 2 commits into
mainfrom
codex/fix-cus-1764-file-document-account
Oct 28, 2026
Merged

FFXN merged 2 commits into
mainfrom
codex/fix-cus-1764-file-document-account

Conversation

@FFXN

@FFXN FFXN commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restore Service API create/update-by-file after the dataset application boundary refactor: initialize the dataset creator's tenant context before saving a document.
  • Keep the existing creator attribution when that account remains in the workspace; use the authenticated workspace owner when the creator is no longer a member.
  • Add regression coverage for account selection and both file write paths.

Related: CUS-1764

Validation

  • uv run --project api pytest api/tests/unit_tests/controllers/service_api/dataset/test_document.py -q — 103 passed
  • Ruff check and format check on the two changed files — passed
  • make type-check PATH_TO_CHECK=api/controllers/service_api/dataset/document.py — passed

After deployment, verify create/update-by-file return 200 and document indexing completes. Previously failed requests may have left unassociated upload records.

From Codex

@FFXN
FFXN requested a review from JohnJyong as a code owner October 28, 2026 11:02
@github-actions github-actions Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 79.89% 79.89% -0.00%
Strict coverage 79.58% 79.58% -0.00%
Typed symbols 76,591 76,592 +1
Untyped symbols 19,358 19,360 +2
Modules 3978 3978 0

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.53%. Comparing base (1f500e5) to head (eb5b5ab).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44972   +/-   ##
=======================================
  Coverage   89.52%   89.53%           
=======================================
  Files        6009     6009           
  Lines      376843   376851    +8     
  Branches    76238    76240    +2     
=======================================
+ Hits       337380   337397   +17     
+ Misses      33465    33455   -10     
- Partials     5998     5999    +1     
Flag Coverage Δ
api 89.39% <100.00%> (+<0.01%) ⬆️

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

hyoban
hyoban previously approved these changes Oct 28, 2026
@FFXN
FFXN added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit e40200d Oct 28, 2026
78 of 84 checks passed
@FFXN
FFXN deleted the codex/fix-cus-1764-file-document-account branch October 28, 2026 15:15
hyoban pushed a commit that referenced this pull request Oct 29, 2026
hyoban pushed a commit that referenced this pull request Oct 29, 2026
hyoban pushed a commit that referenced this pull request Oct 29, 2026
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants