Repository navigation
Add stored transfers: Send as link, stored-link receive and History revoke - #19
Merged
Merged
Conversation
…h croc's store client crocmobile gains StartStoreSend, StartStoreReceive and RevokeStored over storeclient, sharing the transfer lock, with OnStored for the receipt and storeLimit/storeExpired failure codes. Keep Both is settled in the manifest because storeclient's install rename replaces. CrocKit exposes the three calls and TransferEvent.stored; croctest gains store modes and a loopback store server, and verify-interop.sh scenario 14 covers CLI interop both ways, revoke and the file policies.
…s from the controller StoredTransferVault holds each upload's receipt (token and link) in one Keychain item, purges expired ones at launch, and keeps earlier receipts when a write fails. TransferController gains startStoreSend, startStoreReceive, revoke and Phase.stored; history records carry the upload id and expiry as optional fields, and a stored link's hint is only its host. A stored transfer never offers resume: a background expiry says the upload was interrupted and to try again. AppSettings gains the stored-transfer server, and harness runs use an in-memory vault.
…y revoke and the stored-server setting
…rio, a 0.9.9 history upgrade test and the docs page
… revoke fails scenario 14 Scenarios 14a and 14c uploaded with one download and used it before revoking. The store server then answered revoke with 410, which the wrapper and the CLI both count as revoked, so 14b and 14c passed with revoke broken. Two downloads leave one at revoke time. Checked with revoke disabled in RevokeStored (14b fails) and with the CLI revoke skipped (14c fails).
…e Homebrew's bottle lags and has no croc store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Add stored transfers: upload files to a croc store server and share a link (with QR, Copy, Share), receive a stored link, and revoke from History. After this PR a sender can use "Send as link" without the receiver being online, and revoke it later.
Requirements
crocmobile/store.go(StartStoreSend,StartStoreReceive,RevokeStored), CrocKitstartStoreSend/startStoreReceive/revokeStored,TransferControllerstore paths, Send as link toggle, link result screen, History Revoke.StoredTransferVault; History keeps host, id, expiry and revoked date;codeHintstores only the host for stored links.httpsenforced for server and links (localhost exempt) in Go and inTransferLink.TransferRecordadditions are additive;HistoryUpgradeTestsopens a store written with 0.9.9's schema.Plan deviations
v0.9.9(no 0.9.9 build with a persistent harness store exists).Review
Two reviews (HEAD 7127f4f, then 8bad980). First: Important 1 (I1, the revoke harness scenario could pass without revoke working), fixed in 8bad980 and mutation-checked. Second: Important 0, Nit 24 (5 listed, 19 unlisted). None blocks; open ones are in the review notes (SwiftData write after row deletion during revoke, Clear All dropping the only Revoke path for a live upload, docs copy "no upload to someone else's cloud" and the 100-download default).
Verification
Re-run in the ship session at HEAD 8bad980:
scripts/format-swift.sh --lint: exit 0go build,go vet,golangci-lint run ./...:0 issues.;go tool govulncheck -show verbose ./...: 0 vulnerabilities in called code;go test -race ./...: okscripts/build-xcframework.sh: exit 0;swift test --package-path CrocKit: 25 tests in 5 suites passedxcodebuild test -scheme CrocApp -destination 'platform=macOS': TEST SUCCEEDED;xcodebuild buildgeneric iOS and iOS Simulator: rc 0, no warnings from our sourcesscripts/verify-interop.sh(local relay):ALL INTEROP CHECKS PASSED, including the store scenarios (CLI upload, wrapper download, revoke, download fails)scripts/verify-app-mac.sh: rc 0,MAC-STORE-OKscripts/verify-app-sim.sh:SIM-INTEROP-OK;scripts/verify-share-sim.sh:SHARE-SIM-OKNot verified: iPhone background upload, QR scans, Universal Clipboard (O8); Accessibility Inspector and VoiceOver on the P10 views (O12); public-pool interop scenarios; stored-receive Keep Both/Replace through the Receive view; the SwiftData trap in review N1.
CI follow-up
The first CI run failed
interop (local relay): Homebrew's croc bottle was 11.5.0, which has nocroc store, so scenario 14c could not run. The job now installs the CLI withgo installat the version incrocmobile/go.mod(11.5.4);docs/knowledge/tooling.mdupdated. Second run: all jobs green.