···7878 };
79798080 // and make sure all keys at this time are captured from the back
8181- page.ops
8282- .iter()
8383- .rev()
8484- .skip(1) // we alredy added the very last one
8585- .map(|s| serde_json::from_str::<Op>(s).inspect_err(|e|
8686- log::warn!("deduplication failed op parsing ({s:?}: {e}), bailing for downstream to deal with.")))
8787- .take_while(|opr| opr.as_ref().map(|op| op.created_at == last_at).unwrap_or(false))
8888- .for_each(|opr| {
8989- let op = &opr.expect("any Errs were filtered by take_while");
9090- me.keys_at.push(op.into());
9191- });
8181+ me.capture_nth_last_at(page, last_at);
92829383 Some(me)
9484 }
···143133 assert_eq!(last_at, self.last_at, "time moved backwards on a page");
144134 }
145135 // and make sure all keys at this time are captured from the back
136136+ self.capture_nth_last_at(page, last_at);
137137+ }
138138+139139+ /// walk backwards from 2nd last and collect keys until created_at changes
140140+ fn capture_nth_last_at(&mut self, page: &mut ExportPage, last_at: Dt) {
146141 page.ops
147142 .iter()
148143 .rev()