Files
rclone/docs/TODO.md
T

400 lines
24 KiB
Markdown

# TODO
Fork-only durable backlog for things noticed and deliberately not fixed.
Small, specific, independently actionable. Remove only when actually done.
(In Go source, upstream's `FIXME`/`TODO` comment convention still applies.)
## Now
- [ ] protondrive M5 (events, `ChangeNotify`) in progress on branch
`protondrive-m5`: plan `docs/plans/002-protondrive-m5.md`, ledger in
`.superpowers/sdd/002-protondrive-m5/` (copied to
`docs/plans/002-protondrive-m5-workspace/` at pauses).
- [ ] protondrive: the backend rewrite (plan 001) has Tasks 1-21 done
as far as the test accounts allow (live results 2026-11-12 in the
handoff, section 6). Start from
`docs/plans/001-protondrive-tier1-HANDOFF.md`. Remaining: the
whole-branch review and its fix wave.
- [ ] protondrive: the free test account's derived key passphrase (the
`client_salted_key_pass` of a browser sign-in on 2026-11-12) was shown
in an agent's tool output when `rclone config create` printed the new
remote; that session was logged out at once, but the passphrase only
changes with the account password. Owner: change the free account's
password if that matters, then update `~/proton_rclone_test_acc_password`
and the remote's saved password.
## Next
- [ ] protondrive M5: volume events polled no more often than every 30 s,
invalidating the node cache and dircache and feeding `ChangeNotify`, so
`mount` and `serve` see other clients' changes (spec 6.2). Needs its own
plan; also decide the cross-`Fs` cache question below.
- [ ] protondrive M6: opt-in persistent metadata cache of encrypted node
records and the event cursor through `lib/kv` (`metadata_cache`), rclone
Metadata (`mtime`, `btime`, `content-type`), and the SDK's single-request
upload for files under 128 KiB (`files/small`). Needs its own plan; the
docs page and `protondrive.yaml` features change with it.
- [ ] protondrive M7: the upstream path (spec 13), deferred by the owner;
also the new crypto model once Proton publishes it in the SDK.
- [ ] protondrive live checks not yet run (plan Task 21), each of which
the user docs avoid claiming: 2FA, by code and by `otp_secret_key`;
CAPTCHA handling; Proton's desktop and mobile clients reading files
rclone wrote (the web app and the official CLI 0.9.0 have been
checked); whether the real server lists drafts or trashed items as
children (affects `Rmdir`); whether any real address differs from
another of the account only by non-ASCII case (counted as foreign);
how long the server's read-after-write lag after a commit really is
(the client retries for about 7 s).
- [ ] protondrive: `test_all` against the real service (2026-11-12,
free account) fails only the five cross-`Fs` cache tests listed
below; `fstest/test_all/config.yaml`'s `TestProtonDrive:` entry has no
`ignore` for them, so plan Task 21's "clean with no ignore entries" is
not met until that is decided.
- [ ] protondrive: `docs/content/protondrive.md`'s generated options
section still shows the old options and help texts; regenerate it with
`make backenddocs` when the work goes upstream (generated doc changes
are not committed in the fork, per `AGENTS.md`).
- [ ] protondrive: API responses have no body-size limit, and a block
list's `Token` and `BareURL` and the first page's `Thumbnails` are
unbounded, so the 2^19-block cap bounds how many blocks a full read
holds but not the bytes (about 250-350 MiB at the cap with realistic
values, unbounded against a hostile server). Consider a limit on API
response bodies and on those fields.
- [ ] protondrive: confirm on an account whose drive was made by
Proton's own apps (both test accounts' drives were most likely created
by rclone itself) that the
root-of-trust rule passes (the My Files share created, and its root
signed, by one of the account's addresses), and count how many folders
fail key verification.
- [ ] protondrive: a range from offset 0 of a file whose size isn't
recorded (`bytes=0-N`, N at or past the end) is read as a ranged read,
so its manifest isn't checked; only a known size identifies a range
covering the whole file.
- [ ] protondrive: `TestGoldenCapture` refuses files with thumbnails (the
fake server serves none, and the manifest covers them) and keys other
than RSA, EdDSA, Ed25519 and Ed448; images and photos from Proton's apps
can't become golden fixtures until the fake serves thumbnails.
- [ ] protondrive: below the root, a node signed under another user's
email (a shared folder's members) is verified against public keys the
server supplies (`account.publicKeys`), so a hostile server can forge
it; the SDK does the same. Revisit when Proton offers key transparency
or address-key pinning.
- [ ] protondrive: a full read lists every block page before releasing
the first byte, one request per 20 blocks in sequence, so a very large
file waits (about 12 requests for 1 GiB, about 1280 for 100 GiB) before
data flows. Fetching pages in parallel under the 15-request metadata
limit would cut that.
- [ ] protondrive: a ranged read (offset > 0 or a limit, as multi-thread
copies and mounts make) checks each block against the hash the server
lists for it, its decryption and its recorded size, but not the
manifest, so a server can serve validly encrypted blocks of the same
file swapped or from an older revision of the same size. The planned
fix is a bounded per-revision cache of manifest-verified block hashes.
- [ ] protondrive: a server can serve an earlier revision whole (blocks,
manifest and extended attributes, all validly signed) under the current
revision ID undetected, as nothing signed binds them to the revision;
the SDK can't detect it either. Raise with Proton.
- [ ] protondrive: `--dump headers` logs Proton's `pm-storage-token` and
`x-pm-uid` (fshttp redacts only `Authorization`), and `--dump bodies`
logs the access, refresh and upload tokens in JSON bodies (seen in
`TestNoSecretsInLogs`). The docs page warns about it; a header
redaction list in `fshttp` would be an upstream change.
- [ ] protondrive: a name whose signature fails is listed and the file
read with only an `ERROR` logged (spec 6.2, the SDK's behaviour), and
names aren't bound to their node, so a server can swap the encrypted
names of two files in one folder undetected. Raise with Proton.
- [ ] protondrive: a hostile 10 MiB name is decrypted in full before
`validateName` rejects it (about 230 MiB allocated listing it, the
fake included). Consider refusing an encrypted name over a few KiB
before decrypting it.
- [ ] lib/pacer: `TokenDispenser.Get` takes no context, so a cancelled
protondrive block download still waits for a download token (held by
other in-flight blocks, which finish or fail soon) before it notices.
Consider a context-aware `Get`.
- [ ] protondrive: confirm that Proton's desktop and mobile clients read
a file written by Task 5's `crypto.go` (the web app and the official CLI
0.9.0 do, with signatures verified, as of 2026-11-12) (v4 node key
advertising SEIPDv2, v6 PKESK content key, SEIPDv2 GCM blocks, block
signatures encrypted with the content session key). This is what the SDK
(js/v0.23.0) writes, but go-proton-api v1.0.4 `link_file_types.go`
(`SetContentKeyPacketAndSignature`) and Proton-API-Bridge v1.0.5
`crypto.go` (`generateLockedKey`) say the official clients do not reliably
read crypto-refresh files and that the server rejects a v6 content key
packet for a v4 node key; the bridge never sent one with a key advertising
SEIPDv2, so its claim may not apply. Released rclone itself is not the
problem: Task 6's `TestNewWriterOldReader` (removed with the old
libraries in Task 19) showed go-proton-api v1.0.4 and the bridge's block
reader read this format (v6 PKESK, SEIPDv2 blocks and block signatures)
and the new `toISOString` modification time.
- [ ] protondrive: files the old library (go-proton-api v1.0.4 and
Proton-API-Bridge v1.0.5) wrote are covered only by the single-block
frozen fixtures in `backend/protondrive/testdata/oldlib/`
(`TestFrozenFixtures`, `TestFrozenFileFixture`); the multi-block and
empty-file cases left with the differential tests in Task 19. A
multi-block fixture would need the old library back to write it. Nothing
checks any more that released rclone (v1.76 and older) can read what the
new backend writes; that matters to users who downgrade.
Commit `b667a1ab0` still has the differential tests and both libraries,
so such fixtures can be generated from a worktree of it.
- [ ] protondrive: a ranged read of a file which doesn't record its
block sizes (written by some other clients) starts at the furthest
block whose size an earlier read in the same `Fs` learnt
(download.go `blockSizeCache`, 16 revisions, 65536 blocks), else at
the first block. The first chunks of a multi-thread copy, which start
together, still each read from the first block, and a random-offset
read beyond what was read before through a mount is slow. A ranged
read with sizes unknown also fetches up to `downloadAhead` blocks past
its end. Neither cache nor listing tells where a block starts without
reading the ones before it, as the packet framing varies by writer.
- [ ] protondrive: `client.apiCall` retries POST and PUT mutations
(create folder, move, rename, copy) after 5xx and network errors, as the
SDK does. If a lost response hid a success, the retry fails with
`errExists` (2500) or a stale `OriginalHash` (2000) although the change
was made. Consider re-reading the node after such a retry failure.
- [ ] protondrive: `createRevision` (POST `.../files/{id}/revisions`) is
retried by `apiCall` after a lost response like any POST; a retry that
succeeds leaves the first draft revision orphaned on the server (the
fake allows several draft revisions). Find out whether Proton refuses a
second draft revision, and delete or reuse our own if so.
- [ ] protondrive: confirm on a real account what `delete_multiple` does to
an active (non-draft) link. The upload cleanup only sends it for drafts,
and the fake refuses non-drafts, but the SDK's conflict handler sends it
for any `ConflictDraftRevisionID`, which an active file with a draft
revision also reports; Task 11 uploads a new revision in that case
instead.
A `--retries` pass after an upload whose outcome was unknown can reach
the own-draft `delete_multiple` in `resolveConflict` (`upload.go`); it
is decided by Proton's conflict details, which could in theory lag.
- [ ] protondrive: confirm the HTTP status and code Proton returns for a
bad verifier token, a missing block and a stale `CurrentRevisionID`
(the fake uses 422 / 2000, which the spec maps to "upgrade rclone").
- [ ] protondrive: Proton's server can take a moment to show a change
(seen live: a node read just after its commit was missing, or still a
draft with no active revision). The fake models this only through
`Server.SetReadLag`, on the links route after a create, copy or
commit; how long the real lag lasts and whether listings
(`folders/{id}/children`) lag too is unmeasured. Only the reads back
after a commit, a copy and, with `enable_caching` off, of a folder to
write into (`targetFolder`) retry, for about 7 s. Not tolerant yet, and the next
symptoms to expect: `activeNode` (Update, Move, Copy, DirMove of an
object just written) fails "object not found" while the node is
missing or still a draft; Move's read of the moved node may be stale.
- [ ] protondrive: drafts left after an ambiguous commit failure (5xx,
network error, timeout, cancel, or a refusal after the commit was
resent) are never deleted by the client, by design (see DECISIONS,
"a draft is deleted only on an explicit refusal"). The next upload of
the same name by this remote replaces its own draft, but a name never
uploaded again keeps an orphan draft (a new file's draft node, or a
draft revision) taking quota. `CleanUp` only empties the trash. Find
out whether Proton expires drafts by itself, and consider having
`CleanUp` delete this remote's own drafts (by `DraftClientUID`).
- [ ] protondrive: `errUploadUnconfirmed` is not retried at once, but a
whole-sync `--retries` pass lists again; if the listing still lags it
uploads the file again, adding a revision with identical content
(wasted work and version history, no data loss).
- [ ] protondrive: several `Fs` of one account in one process each have
their own node cache; only Move/DirMove sources are invalidated across
them. A name missing from one `Fs`'s cached listing stays missing after
another `Fs` creates it, so `--compare-dest`, `--copy-dest` (with
`--immutable`) and `checksum --download` decide on stale listings when
the other `Fs` writes during the run, and an `Fs` made on a path that
doesn't exist yet never finds it once it is made elsewhere. Five
`test_all` tests fail for this and are in the `ignore` list of
`TestProtonDriveFake:` (`fstest/test_all/config.yaml`):
`TestCheckSumDownload`, `TestCopyFileCompareDest`,
`TestCopyFileCopyDestImmutable`, `TestSyncCompareDest`,
`TestSyncCopyDestImmutable`; all pass with `enable_caching = false`.
Events polled every 30 s (spec 6.2) will not close a window of
seconds. Re-listing on every cache miss fixes them but breaks
`TestBudgetUpload` and `TestBudgetMkdir` (a folder re-listed per new
file). A cache shared by the `Fs` of one account would fix them, but
is package state, which the spec rules out: owner decision.
Related and wider: with no cache expiry and no events (M5), a long
`rclone mount` never sees changes made by other clients (web app,
another rclone) to folders it has already listed. A listing TTL would
bound that but would not fix the five tests above.
- [ ] protondrive: `cmd/gitannex` is in `ignoretests` for
`TestProtonDriveFake:` because its remote name check
(`cmd/gitannex/configparse.go`, `config.GetRemoteNames`) sees remotes
set by environment variables lower cased, as for every other init.d
remote; it says nothing about the backend. Run it against a remote in
a config file to cover it.
- [ ] `.gitea/workflows/ci.yml` could not be run locally. The Gitea has
an Actions runner (slow, so the workflow is kept light: 20 s per fuzz
target, a 45 minute job timeout, no `test_all`); the first push must
confirm the runner picks the workflow up.
- [ ] protondrive: browser sign-in in `rclone config` waits up to 10 minutes
polling; a non-interactive `config create` without username and password
waits the same.
- [ ] Propose a CI check for this fork: `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`
and the `docs/` agent files exist, and `AGENTS.md` is at most 150 lines.
### final review minors (2026-11-12)
- [ ] protondrive (final re-review): ranged reads place their start from
block sizes in extended attributes even when those are unsigned, so a
forging server can shift the bytes a ranged read returns (full reads
are unaffected).
- [ ] protondrive (final re-review): `TestMain` applies `RCLONE_CONFIG`
only when it is set; with it unset, tests may still find the user's
config.
- [ ] protondrive (final re-review): the draft client ID stays random per
run when the remote has a config section that can't be saved.
Minors from the whole-branch review (`final-review-*.md` in the plan
workspace) not fixed in its fix wave. Paths are under `backend/protondrive/`.
- [ ] A node fetched while it is being changed can overwrite the newer
cached node and stay cached: `put` after `fetchLinks` has no per-node
generation (`nodes.go` `fetchNode`, `cache.go` `put`).
- [ ] Unbounded per-client maps: `client.folderKeys` (kept whatever the
cache), the node cache, `client.reported`, `account.foreign`; `close()`
doesn't clear the private keys of cached file nodes.
- [ ] `listChildren` loops until ctx ends if the server keeps answering
`More` with the same `AnchorID` (`nodes.go`); stop when a page adds
nothing new.
- [ ] The name and hash key signature date exemptions
(`nameSignedSince`, `hashKeySignedSince`) and the content key fallback
read the server-supplied `CreateTime`, so a server can back-date a node
to exempt it (commented in `nodes.go`, as in the SDK).
- [ ] Earlier deferred crypto minors still present: the node passphrase
isn't checked as UTF-8 (`crypto.go` `decryptNodeKeys`); `publicKeys`
waiters get the fetching caller's ctx error (`account.go`);
`setChildrenLocked` overwrites a cached node without `put`'s
changed-parent rule (`cache.go`); an xattr `"Size": null` reads as 0
and skips the block-size fallback (`crypto.go` `parseXAttrs`); Move
detects an anonymous node by `SignatureEmail == ""` (`nodes.go`
`encryptForNewParent`).
- [ ] `publicKeyRing` rebuilds the own-address public ring on every
lookup, 2-3 times per decrypted node (`account.go`); build it once in
`loadAccount`.
- [ ] Two processes sharing one config (a mount and a cron job) can
delete each other's in-progress draft of the same new name, since the
draft client ID is per remote (`upload.go` `resolveConflict`).
- [ ] `pm-storage-token` is still sent if a storage request is
redirected to another host (`download.go` `downloadBlock`, `upload.go`
block upload); set `CheckRedirect` or refuse redirects.
- [ ] `errUploadMismatch` is a `NoRetryError`, so a source that changes
while read fails for the whole run, `--retries` passes included
(`protondrive.go` `translateError`); consider `NoLowLevelRetryError`.
- [ ] An own leftover draft revision on an active file is never deleted
and keeps taking quota (`upload.go` conflict path).
- [ ] A `createDraft` resend can report the client's own new draft as
one that "came back after it was deleted" (`upload.go` `createDraft`).
- [ ] Two `Fs` of an environment-configured remote in one process can't
see each other's token refresh, so the second fails with "session
expired" (`protondrive.go` `configStore`); document it.
- [ ] `rclone config` on a remote with a saved session asks "Already
signed in - sign in again?" with default no, even when the session is
dead and the user followed the reconnect hint (`protondrive.go`
`Config`, ruling 17).
- [ ] After a CAPTCHA in `rclone config`, the method question defaults
back to password sign-in (`protondrive.go` `Config`).
- [ ] A wrong key password on a saved session says "is the password
right?" without the reconnect hint (`account.go` `loadAccount`,
`protondrive.go` `connect`).
- [ ] Token refresh hasn't been seen working against the real server,
and its request lacks the `UID` and `RedirectURI` go-proton-api sends
(`api/types.go` `AuthRefreshRequest`); add it to the live checks.
- [ ] Session minors deferred since Tasks 2-4: an adopted stored token
whose access token is stale fails one call with a 401; the refresh uses
the first waiter's ctx; `serverTime` can step back; the half-signed-in
cleanup `DELETE` uses a possibly cancelled ctx; an empty SRP salt isn't
refused up front; `GET /core/v4/users` is fetched twice at sign-in
(`session.go`, `account.go`).
- [ ] Server-side Copy onto an existing name falls back to download and
re-upload (`protondrive.go` `Copy`).
- [ ] `Precision()` is 1 s while `ModTime` has milliseconds;
cross-account Move/Copy/DirMove aren't refused; the on-the-fly remote
hint names the bare backend; logging passes `nil`, not the `Fs`,
throughout (sweep before upstream).
- [ ] Goroutine-count leak checks remain (`download_internal_test.go`
`requireNoLeaks`, `nodes_internal_test.go`); don't add more.
- [ ] `TestListingRacingChange` can hang to the package timeout if it
fails before closing `release` (`nodes_internal_test.go`).
- [ ] `protonfake` `TestRun` leaks the `run` goroutine on a failed
require (`protontest/cmd/protonfake/main_test.go`).
- [ ] `TestClientBootstrapCreateVolumeRace` waits a fixed 2 s, and
`TestAcquireTokenCancel` sleeps 20 ms to let the wait start
(`nodes_internal_test.go`, `upload_internal_test.go`).
- [ ] The init.d `stop` has no SIGKILL escalation, and shellcheck reports
SC2034 (`fstest/testserver/init.d/TestProtonDriveFake`).
- [ ] CI runs on both `push` and `pull_request` with no `concurrency`
group, so twice per PR push (`.gitea/workflows/ci.yml`); check Gitea
supports `concurrency` first.
- [ ] The fake's read lag (`protontest` `SetReadLag`) never runs with the
contract suite; consider a second `fstests.Run` or a `protonfake
-read-lag` flag.
- [ ] The docs page describes CAPTCHA handling, 2FA prompting and
account-wide `about` that are proven only against the fake, while this
file says the docs avoid claiming them; soften one or the other.
- [ ] `rclone config create` and `config show` print the new remote's
`client_*` tokens and salted key password, which survives a logout;
add a docs line not to paste that output.
- [ ] `docs/PERMISSIONS.md` and `.claude/`/`.gemini/` allow
`golangci-lint run` but `.codex/rules/project.rules` doesn't; bring it
in step (owner, as it is a permission change).
## Someday
## Recurring
- [ ] Maintain `AGENTS.md`:
- **Add a rule only in response to a real failure.** Do not pre-empt
hypothetical mistakes.
- **Update in the same commit as the convention change.**
- **Prune quarterly**, and re-check the Fork Workflow section against
upstream's `AGENTS.md` after each upstream merge.
## Known issues
- [ ] On the development host (Go 1.27.4) `RCLONE_CONFIG=/notfound go test ./...`
fails only `cmd/serve/s3`, unrelated to this work and undiagnosed (seen
2026-11-11 before the Proton Drive rewrite began). That is the baseline
for plan Task 19's "no new failures"; the container list below is not.
- [ ] On the development host on 2026-11-12, `cmd/bisync` `TestRcBackupDir`
(`backupDir1`, `backupDir2`) fails every run with "unable to find file
.../backup/file0.txt", also at `06700aaf2` (before the Proton Drive
rewrite), so it is not caused by that work; undiagnosed. `cmd/serve/s3`
passed in the same full run.
- [ ] `RCLONE_CONFIG=/notfound go test ./...` in the bare `golang:1.26`
container fails 7 packages (list in `docs/PERMISSIONS.md`). `fs/logger`
needs `rsync`; the mount, serve and smb failures are undiagnosed and are
probably missing container tooling (FUSE, git-annex), not code. Confirm on a
host with Go installed before treating a full-suite failure as a regression.
- [ ] protondrive: `TestRegressionManyNewFs` can't see from the fake
server that key unlocks run one at a time; only
`TestLoadAccountSerialised` (internal, `unlockHook`) checks it.
- [ ] protondrive: an address key's `Token` (account.go
`unlockAddressKey`) is decrypted without a decompression limit, unlike
node metadata (`decryptMessage`); a hostile server could send a
compression bomb there too. Seen in Task 17.
- [ ] protondrive: API error bodies are read whole and their `Error`
message is logged as the server sent it, of any length and with any
control characters (session.go `errorHandler`). Bound and sanitise it
if a hostile server is in scope for logs. Seen in Task 17.
- [ ] protondrive: a new revision (`createRevision`), a move, rename or
trash still forget the parent folder's cached listing, so `Put` over
existing files in one folder lists it again each time (`sync` is not
affected: it calls `Update`). New files and folders are added to the
listing instead since Task 17.
- [ ] protondrive: spec 9.5 asks for a fuzz target for event decoding;
add it with events (fuzz_internal_test.go).
- [ ] protondrive: the account's own user keys (account.go `loadAccount`)
are unlocked without the Argon2 limits node and share keys get
(crypto.go `checkKeyS2K`): the server stores them too, so a hostile
server could make sign-in run a KDF of up to 2 TiB. Left out because a
genuine user key's S2K parameters aren't known to be within the
limits; check what Proton's apps write before applying them. Address
keys are safe: their token's signature is checked first.