Skip to content

fix: e2e downloads finish while a step is attached - #2332

Merged
vilenarios merged 1 commit into
devfrom
e2e-save-route
Oct 21, 2026
Merged

vilenarios merged 1 commit into
devfrom
e2e-save-route

Conversation

@vilenarios

@vilenarios vilenarios commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

This fixes a bug in my own #2328, found by the final 2.90.0 e2e run, and catches the guide up with that run.

The bug

#2328's stand-in for the save dialog passed the bytes to launch.js through ctx.exposeBinding. Every Playwright client attached over CDP hears a binding call, and that includes step.js. When a step was still connected as a download finished, step.js answered first with Function "__e2eSave" is not exposed. The app then showed File download failed, even though every byte had been saved. My own check for #2328 compared the bytes but never looked at the screen, so I missed it.

The fix

The page now fetches https://e2e-save.invalid/<name>?op=open|write|close, and a ctx.route in launch.js answers it. Only the client that set up the route intercepts it, and the request never leaves the browser. Each body is a base64 string sent as text/plain, which keeps every request simple, so there is no CORS preflight.

Guide

  • On a new profile, the sync action is now the header split button (ui: one sync button on Your drives, and ticking drives turns the heading into the selection #2327), not a banner button.
  • labels() returns nothing until Flutter's semantics tree is on. The guide now says how to turn it on, and to do that last.
  • Journey 7: at failure rate 0.3 the uploader often retries its own way through and shows no dialog. Use 1.0 to bring up the dialog, then 0.3 for the Re-Uploads.
  • The duplicate-file dialog shows Skip only when several files are uploading.
  • A WSL copy of the tools needs assets/config beside tool/web_e2e, because launch.js reads the Turbo services from ../../assets/config.

Verified on staging (a88146448), test wallet, tools run from a Linux copy

  • A private file download with the step kept connected for 25 s afterwards: Download finished!. net.log logs download … 51200 bytes, and cmp with the uploaded original says identical.
  • In the same session, the Land on Your drives or sign in when the attach dialog is cancelled #2325 logged-in check the e2e run couldn't do: a link to another wallet's private drive opened the attach dialog, and Cancel landed on Your drives at #/drives. On the way, a public drive linked first was attached automatically, as designed. I detached it afterwards.

0 AR spent, no uploads.

🤖 Generated with Claude Code

https://claude.ai/code/session_019ZiqyGae4T1gJLGGB29pR9

Summary by CodeRabbit

  • Documentation

    • Updated web end-to-end testing guidance for the current sync controls, accessibility behavior, release-checklist scenarios, duplicate-upload dialogs, and WSL setup requirements.
  • Tests

    • Improved browser download handling in end-to-end test flows, including more reliable file creation, appending, completion tracking, and error validation.

…ches up

- the save-dialog stand-in sends the bytes as requests launch.js routes,
  not through an exposed binding: every client attached over CDP hears a
  binding call, and step.js answered it with "not exposed", so the app
  showed "File download failed" though every byte was saved
- the guide: the sync split button on a new profile, how to turn on the
  semantics tree for labels(), journey 7 at rate 1.0 then 0.3, the
  duplicate-file dialog's buttons, and copying assets/config for a WSL copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ZiqyGae4T1gJLGGB29pR9
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ardriveapp/ardrive-web/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58a7bf06-711e-4e01-880d-1fc774a5a513
📥 Commits

Reviewing files that changed from the base of the PR and between a881464 and e199588.

📒 Files selected for processing: 2
  • docs/WEB_E2E_TESTING.md
  • tool/web_e2e/launch.js

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

📝 Walkthrough

The E2E launcher now handles download operations through an intercepted SAVE_URL route. The testing guide updates instructions for current sync controls, accessibility semantics, upload scenarios, and WSL setup.

Changes: Web E2E Testing

Layer / File(s) Summary
Route browser save operations
tool/web_e2e/launch.js
The file picker sends open, write, and close requests to SAVE_URL. The route creates or appends download files, logs completed sizes, and returns success.
Update E2E testing instructions
docs/WEB_E2E_TESTING.md
The guide updates new-profile sync steps, Flutter semantics guidance, wallet-upload failure testing, duplicate-name options, and WSL directory requirements.

Priority: ⬇️ Low

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant FilePicker
  participant SaveRoute
  participant Filesystem
  FilePicker->>SaveRoute: POST open, write, and close operations
  SaveRoute->>Filesystem: Create or append download file
  SaveRoute-->>FilePicker: Return success response
Loading
Merge Risk: ⚪ Minimal · up to e1995

No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: fixing E2E downloads so they complete while a step remains attached.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 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

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 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.

@vilenarios
vilenarios merged commit ec2eae6 into dev Oct 21, 2026
5 of 7 checks passed
@vilenarios
vilenarios deleted the e2e-save-route branch October 21, 2026 01:07
@vilenarios vilenarios mentioned this pull request Oct 21, 2026
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit e199588):

https://ardrive-web--pr2332-e2e-save-route-5wt85gm3.web.app

(expires Wed, 28 Oct 2026 01:44:31 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0

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.

1 participant