Skip to content

fix browser opfs partial writes in ci#117

Merged
KSemenenko merged 1 commit intomainfrom
codex/fix-browser-opfs-ci
Mar 31, 2026
Merged

fix browser opfs partial writes in ci#117
KSemenenko merged 1 commit intomainfrom
codex/fix-browser-opfs-ci

Conversation

@KSemenenko
Copy link
Copy Markdown
Member

Summary

  • handle partial OPFS writes in the browser worker by draining each chunk in smaller blocks
  • surface upload failures directly in the browser large-flow playgrounds instead of masking them as UnexpectedLength
  • keep the 1 GiB browser verification unchanged while making the CI path reliable

Verification

  • dotnet test Tests/ManagedCode.Storage.Tests/ManagedCode.Storage.Tests.csproj --configuration Release --filter "FullyQualifiedNameBrowserStorage_ServerHost_LargeFlow_ShouldPersistAcrossPages|FullyQualifiedNameBrowserStorage_WasmHost_LargeFlow_ShouldPersistAcrossPages"
  • dotnet test Tests/ManagedCode.Storage.Tests/ManagedCode.Storage.Tests.csproj --configuration Release --filter "FullyQualifiedName~ManagedCode.Storage.Tests.Storages.Browser"
  • dotnet test Tests/ManagedCode.Storage.Tests/ManagedCode.Storage.Tests.csproj --configuration Release
  • dotnet format ManagedCode.Storage.slnx
  • dotnet build ManagedCode.Storage.slnx

Copilot AI review requested due to automatic review settings March 31, 2026 19:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves reliability of browser OPFS (Origin Private File System) uploads—especially in CI—by handling partial FileSystemSyncAccessHandle.write() results and by surfacing real upload failures in the browser storage playground UIs instead of masking them as UnexpectedLength.

Changes:

  • Add a write loop in the OPFS worker to drain each chunk via smaller block writes until fully written (tolerating short writes).
  • Update both Wasm and Server storage playground pages to immediately report UploadAsync failures (and only use UnexpectedLength when the upload reports success but the deterministic stream did not fully drain).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Storages/ManagedCode.Storage.Browser/wwwroot/browserStorage.worker.js Implements block-based “write until complete” behavior to handle partial OPFS writes reliably.
Tests/ManagedCode.Storage.BrowserWasmHost/Pages/StoragePlayground.razor Stops masking upload failures as UnexpectedLength; reports upload failure details directly.
Tests/ManagedCode.Storage.BrowserServerHost/Components/Pages/StoragePlayground.razor Same failure-reporting behavior change as the Wasm playground.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.55%. Comparing base (710b8bb) to head (6c9b6fe).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...erverHost/Components/Pages/StoragePlayground.razor 0.00% 5 Missing ⚠️
...rage.BrowserWasmHost/Pages/StoragePlayground.razor 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   57.27%   48.55%   -8.72%     
==========================================
  Files         133      153      +20     
  Lines        6540     7702    +1162     
  Branches      922     1029     +107     
==========================================
- Hits         3746     3740       -6     
- Misses       2362     3528    +1166     
- Partials      432      434       +2     

☔ View full report in Codecov by Sentry.
📢 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.

@KSemenenko KSemenenko merged commit 2cf1b9c into main Mar 31, 2026
7 of 9 checks passed
@KSemenenko KSemenenko deleted the codex/fix-browser-opfs-ci branch March 31, 2026 19:52
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.

2 participants