Repository navigation
feat(cli): remote folders and telemetry consent; fix spaces in remote folder names - #102
Conversation
The profile editor's remote folder dropdown split `rclone lsd` output on whitespace and kept the last token, so "My Folder" was offered as "Folder" (colliding with a real folder of that name) and "My songs" as "songs". Present since the view was written, not a regression. List folders with `rclone lsf --dirs-only` (one name per line, no columns) through a shared RcloneConfigService.parseDirectoryListing used by the chooser, the setup wizard and the Sync Only These Folders browser. stderr is now read separately so rclone notices can't show up as folders. Covered by ConfigSelfTest AC-RF1. Claude-Session: https://claude.ai/code/session_01DXZWhCBFdN1o8jnSB8gd7t
…s the app sees them Lists a remote's folders through the same rclone arguments and parser as the profile editor's folder chooser and the setup wizard, so a folder-name problem like the "My Folder" shown as "Folder" bug can be reproduced and reported from a terminal. Needs no profile; --json makes leading and trailing spaces visible. The listing arguments now live in RcloneConfigService.folderListingArguments, shared by the chooser, the wizard and the CLI. Covered by ConfigSelfTest AC-CLI12.
The CLI now honours the same telemetry setting as the app instead of
silently following whatever the app last stored:
- First run asks once ("Share usage data? [y/N]") with the banner's own
copy, default No. Only on an interactive terminal outside CI, never for
help or telemetry itself, so scripts and agents are never blocked.
- `synctray telemetry [status|on|off] [--json]` reads/changes it, and
writes settings.json (that key only) so a running app applies it live.
- CLI telemetry carries synctray.process.kind=cli (app sends app);
service.name stays synctray so existing queries keep working.
- Exporter diagnostics are silent in CLI mode.
Covered by ConfigSelfTest AC-CLI13.
|
Darkplane auto-approval is enabled for this repository (mode: Auto-approve). Trigger an evaluation for this pull request when it is ready: |
✅ No issues foundNo new commits since the last review at a1831f8; the edited description now covers the follow-up fixes, all three prior threads are resolved, and CI is green. Progress: open review threads 1 → 2 → 0 → 0 across the last 4 reviews Review details
Found Quality — produced 0 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 0 Run incremental · 0 lines in delta · tier deep · depth checkout Nothing to report — standards (skipped), optimality (skipped), measurability (skipped), integrations (skipped), severity, 0 files skipped.
|
Addresses pr-reviewer comment #102 (comment)
… browser Addresses pr-reviewer report (Less certain)
… paragraph Addresses pr-reviewer report (Less certain)
…ting folders Reading stdout to EOF before stderr deadlocks once rclone fills the unread stderr pipe's ~64 KB buffer. Add RcloneConfigService.drainPipes, which reads stderr on a background queue while reading stdout, and use it at all three folder-listing sites. AC-RF1 now runs a child writing 300 KB to both pipes under a 10 s timeout and pins drainPipes at each site. Addresses #102 (comment)
Summary
Three changes, plus the review loop's follow-up fixes.
fix(settings): keep spaces in remote folder names (87a4ee5, e07777e, 7ee2ce4)
Reported on Reddit: a remote folder named
My Foldershowed up asFolderin the profile editor's folder chooser. The chooser parsedrclone lsdoutput, which is a whitespace-padded column, by splitting on spaces. Everything before the last space was lost. This is not a regression; the bug has been there since the chooser was added (792bfe8).rclone lsf --dirs-only, which prints onename/per line verbatim. They sharefolderListingArgumentsandparseDirectoryListing. The three sites are the setup wizard (RcloneConfigService.listFolders), the folder chooser (ProfileDetailView.loadRemoteFolders) and the "Sync Only These Folders" browser (RemoteFolderBrowserSheet). Leading, trailing and doubled spaces, and non-ASCII names, survive. The wizard's list is now sorted.RcloneConfigService.drainPipes. Reading one pipe to the end first deadlocks once the other fills its ~64 KB buffer. The CLI's own rclone runner now uses the same helper. stderr is kept apart from the listing, so an rclone warning can't show up as a folder.feat(cli):
synctray remote folders <remote>[:path] [--json](fb68598)Lists a remote's folders exactly as the app shows them, with the same arguments (including the remote's
no_check_certificate) and the same parser. It needs no profile.--jsonmakes leading and trailing spaces visible.feat(cli): ask for usage-data consent once and share it with the app (1120507, 612b050, 0bf1782)
Share usage data? [y/N], default No). It asks only on an interactive run of a command that parses, and only while the question is unanswered. The question counts as answered once the user has answered it in the app's banner or setup wizard, or in the CLI, for the current consent version.CImust be unset;helpandtelemetrynever ask.synctray telemetry [status|on|off] [--json]: the sametelemetryEnabledsetting the app uses. It also writes that one key tosettings.json, so a running app applies the change live, and it never toucheslaunchAtLogin.synctray.process.kind=cli, and the app sendsapp.service.namestayssynctray, so existing queries keep working.Not addressed here
The include-folder browser now shows folder names with leading or trailing spaces exactly as they are.
SyncProfile.normalizedSyncIncludeFoldersstill trims them on save, though, so such a folder can't be selected for "Sync Only These Folders". The trimming predates this PR.Test plan
SyncTray --self-test: 123 checks pass. Each check below was confirmed to fail against the broken code.remote folders.telemetryparse/output, and thesettings.jsonkey-only update.My Folder,My songs,trailing spaceandCafé: listed verbatim as text and as--json.telemetry status/on/off; piped runs never ask; a bad argument exits 64;settings.jsonround-trips byte-identical.scripts/check-schema-in-sync.shpasses.