Accept and diagnose escrow metadata variations - #1
Merged
gregakespret merged 2 commits intoAug 29, 2026
Conversation
(cherry picked from commit 96c1228)
- login_apple_delegates no longer discards the validation-data error with `.ok()`. A transient relay/anisette failure omitted X-Mme-Nas-Qualify and came back as UNAUTHORIZED, which callers read as bad credentials and answered with a full re-login/2FA. Log the real cause at warn!. - fetch_viable_bottles decoded escrow metadata with base64_decode, which unwraps internally: a blob using the URL-safe alphabet, embedded newlines or non-canonical padding panicked and aborted the whole export, ahead of the tolerant handling right below it. Added base64_decode_checked and count such a record as invalid_metadata instead. - Raised the metadata shape diagnostic from debug! to warn!, matching the sibling "not a valid plist" arm and the summary counter. At default log levels an operator saw the count but never which keys or types mismatched. - Renamed new_with_host's third parameter to escrow_proxy_url; it takes a full URL, and a bare host produced reqwest's RelativeUrlWithoutBase far from the constructor. - Committed the regenerated Cargo.lock, stale since the submodule bump in e3d2ea4: `cargo check --locked` failed and a plain build dirtied the tree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017VmSAa6yRzmHW6kK55g57w
This was referenced Aug 29, 2026
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.
Builds on upstream stek29/rustpush@96c1228, cherry-picked onto
findmy-export-support.EscrowMetadata::passcode_generationis a requiredu32, so any escrow record Apple returns withoutpasscodeGenerationfails to deserialize — andget_viable_bottlesdiscarded those silently, via.ok()?inside afilter_map. The user saw "No escrow bottles found. Make sure you have another trusted device." with no way to tell that apart from an account that genuinely has no escrow. It is our single biggest connect failure: 22 sessions across four users in the six days Railway retains logs.The field is now
#[serde(default)], and bottle selection is an explicit loop that accounts for every record it drops:info!with the record and viable-bottle counts — the discriminator for the failure, since our own count is taken after the discardingwarn!naming the serde error and the metadata's top-levelkey:typeshape when a record does not fit the structwarn!for metadata that is not valid base64, or that decodes but is not a valid plistwarn!counting both kinds of discardEvery discard path is at
warn!because every one of them costs the user a bottle; the shape dump is the only thing that says which key or type disagreed, so it has to survive default log levels. Decoding goes through a newbase64_decode_checked, since the existingbase64_decodeunwraps internally and a malformed blob would abort the whole export ahead of any of this.The diagnostics carry counts, key names and value types — never a metadata value and never key material.
Two adjacent papercuts on the same path:
login_apple_delegatesdiscarded the error fromgenerate_validation_datawith.ok(). That call is a network POST, so a transient relay blip droppedX-Mme-Nas-Qualifyand came back asUNAUTHORIZED, which callers read as bad credentials and answer with a full re-login and 2FA. The error is now logged.KeychainClientState::new_with_hosttakes a full URL, not a bare host — a schemeless value only fails later, inside reqwest. The parameter is named and documented accordingly.Cargo.lockis regenerated against the current submodule pin; it was stale enough thatcargo check --lockedrefused to build and a plain build left every tree dirty.Consuming this needs the matching
export-findmychange: theinfo!is dropped by that repo's keychain redaction allowlist until its prefix is added (gregakespret/export-findmy#TBD).cargo check --locked --libpasses, both with default features and with--no-default-features --features remote-anisette-v3.🤖 Generated with Claude Code
https://claude.ai/code/session_017VmSAa6yRzmHW6kK55g57w