Repository navigation
fix(mobile): create and edit notes on headless hosts - #31291
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Make the disk precondition and write atomic. · headless-markdown-document.ts:141-143
src/main/runtime/files/headless-markdown-document.ts:141-143
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftMake the disk precondition and write atomic.
HeadlessMarkdownDocuments.savecallswriteFileWithDiskPreconditionafter the mobile route selects the headless path. The shared writer checks the signature and then callswriteFileseparately. Another process can edit the file between those operations. The mobile content then overwrites that edit, and the reread reports success because it sees the mobile content. This violates the conflict and data-preservation behavior. Move a true compare-and-write guarantee into the shared local writer. The existing in-process queues do not protect against another process.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ab139c6f-16b9-44f8-9279-b324833981d1
📒 Files selected for processing: 1
config/tsconfig.e2e.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
#31291 added HeadlessMarkdownDocuments for windowless phone Markdown reads and saves, next to the window relay. This branch replaces both with one path through main and the disk, so its read/save wiring and module are dropped; its headless editor-open and session-update changes stay, and its e2e (headless-mobile-markdown.spec.ts) runs against the merged path.
… the file, as main does since #31291 (test only)
…nge and draws only main's update (dark, layout-owner build only) (#31438) * Editor tabs main-first: the window sends each editor action to main and draws editor tabs only from main's frames (dark, layout-owner build only) With ORCA_LAYOUT_OWNER_IS_MAIN on, editor open (preview replace, open to the side), reopen at its position, close, close-all, promote, the resolved conflict placeholder, a restored-editor move and a disk rename are layout commands the window sends before it draws anything. Window content (open file records, drafts, buffers, the autosave gate) is written at once for an open, and rekeyed in the same store update as the frame for a move or rename. Main publishes each non-edit tab's view, keeps views in memory across applies and partition changes, stamps the tab's time, folds same-file duplicates, and republishes a windowless host's session.tabs after its own file open. The switch-off path is unchanged. * test(d3a-2): the buffer view index follows a rename main answers * test(e2e): the old-phone baseline records a windowless server opening the file, as main does since #31291 (test only)
Creating a Markdown Note from a phone paired to a headless host failed with
renderer_unavailableafter creating the file. Every retry left another orphan note. Headless hosts now open persisted editor tabs and read/save notes through the existing authorized filesystem and disk-precondition writer.Reproduction (iPhone 17 Pro simulator, iOS 26.1): pair directly to a headless host, open a workspace, tap New Tab → Markdown Note. Before: error toast and no note tab. After: the note opens, accepts text, and saves to disk.
Validation: paired-headless RPC regression covers creation, read, save, stale phone conflicts, external edits, and closing; 13 editor/projection unit tests pass;
pnpm tc:nodeand changed-code quality pass. Simulator screenshot below shows the saved result. Desktop-paired note creation/edit/save was also exercised.Before:
(screenshot removed: contained real product data)
After:
(screenshot removed: contained real product data)
Addresses the headless Markdown-note reproduction in #22186, reported by @shota46. Related community work reviewed: @Jinwoo-H's #31101 (disk-backed Markdown tab reads/saves), @brennanb2025's #25436 (broader host-owned editor tabs, SSH, and diffs), and @Meapri's #23357 (device-side file/diff fallback, explicitly leaving new notes for separate work). Thank you for the reports, implementations, and regression coverage. This PR is an independently implemented, narrower headless-note fix; it does not supersede those PRs' remaining scope or claim their commits as its own.