Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat(enterprise-sync): include memories in telemetry upload

Louis Beaumont5e033196741e
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/enterprise_sync.rs b/apps/screenpipe-app-tauri/src-tauri/src/enterprise_sync.rs
index a5127d3f6..dce6649f7 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/enterprise_sync.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/enterprise_sync.rs
@@ -26,8 +26,8 @@ mod imp {
use crate::recording::local_api_context_from_app;
use base64::Engine;
use ee_sync::{
- AudioRow, EnterpriseSyncConfig, EnterpriseSyncError, FrameRow, LocalApiClient, SnapshotRow,
- UiEventRow,
+ AudioRow, EnterpriseSyncConfig, EnterpriseSyncError, FrameRow, LocalApiClient, MemoryRow,
+ SnapshotRow, UiEventRow,
};
use serde::Deserialize;
use std::sync::Arc;
@@ -117,6 +117,26 @@ mod imp {
name: Option<String>,
}
+ // /memories has a different envelope from /search — it's a paginated list,
+ // not a typed-search response. Tags arrive already-parsed as a JSON array.
+ #[derive(Debug, Deserialize)]
+ struct LocalMemoriesResponse {
+ data: Vec<LocalMemoryItem>,
+ }
+
+ #[derive(Debug, Deserialize)]
+ struct LocalMemoryItem {
+ id: i64,
+ content: String,
+ source: String,
+ #[serde(default)]
+ tags: Vec<String>,
+ importance: f64,
+ frame_id: Option<i64>,
+ created_at: String,
+ updated_at: String,
+ }
+
#[async_trait::async_trait]
impl LocalApiClient for ScreenpipeLocalClient {
async fn fetch_frames_since(
@@ -363,6 +383,55 @@ mod imp {
height: h,
}))
}
+
+ async fn fetch_memories_since(
+ &self,
+ since_ts: Option<&str>,
+ limit: u32,
+ ) -> Result<Vec<MemoryRow>, EnterpriseSyncError> {
+ // /memories filters by created_at >= start_time; ascending order
+ // means the cursor advances monotonically. Server-side dedup is
+ // on (device_id, memory_id), so a single-row overlap per tick is
+ // acceptable (same convention as /search-backed fetches above).
+ let mut url = format!(
+ "{}/memories?limit={}&order_by=created_at&order_dir=asc",
+ self.api_url_base, limit
+ );
+ if let Some(ts) = since_ts {
+ url.push_str(&format!("&start_time={}", urlencoding::encode(ts)));
+ }
+ let resp = self
+ .auth(self.http.get(&url))
+ .send()
+ .await
+ .map_err(|e| EnterpriseSyncError::LocalApi(e.to_string()))?;
+ if !resp.status().is_success() {
+ return Err(EnterpriseSyncError::LocalApi(format!(
+ "GET {} -> {}",
+ url,
+ resp.status()
+ )));
+ }
+ let body: LocalMemoriesResponse = resp
+ .json()
+ .await
+ .map_err(|e| EnterpriseSyncError::LocalApi(format!("decode: {e}")))?;
+ let out = body
+ .data
+ .into_iter()
+ .map(|m| MemoryRow {
+ memory_id: m.id,
+ created_at: m.created_at,
+ updated_at: m.updated_at,
+ content: m.content,
+ source: m.source,
+ tags: m.tags,
+ importance: m.importance,
+ frame_id: m.frame_id,
+ })
+ .collect();
+ Ok(out)
+ }
}
// ─── Spawn ─────────────────────────────────────────────────────────
diff --git a/ee/desktop-rust/enterprise_sync.rs b/ee/desktop-rust/enterprise_sync.rs
index 40403352d..28a21b6a7 100644
--- a/ee/desktop-rust/enterprise_sync.rs
+++ b/ee/desktop-rust/enterprise_sync.rs
@@ -184,6 +184,11 @@ pub struct Cursor {
/// from before UI events were added.
#[serde(default)]
pub last_ui_ts: Option<String>,
+ /// ISO-8601 UTC. Latest `memories.created_at` we've ingested.
+ /// Optional in serde to remain backwards-compat with cursor files from
+ /// before memory sync was added.
+ #[serde(default)]
+ pub last_memory_ts: Option<String>,
}
impl Cursor {
@@ -272,6 +277,19 @@ pub trait LocalApiClient: Send + Sync {
async fn fetch_latest_snapshot(&self) -> Result<Option<SnapshotRow>, EnterpriseSyncError> {
Ok(None)
}
+
+ /// Fetch memories (user/AI-curated facts, preferences, decisions) created
+ /// since `since_ts`, ordered by `created_at` ascending, capped at `limit`.
+ /// Memories are the *distilled* layer above the raw frame/audio firehose —
+ /// they're what makes a team's institutional knowledge portable. Default
+ /// empty impl lets clients that predate this signal keep working.
+ async fn fetch_memories_since(
+ &self,
+ _since_ts: Option<&str>,
+ _limit: u32,
+ ) -> Result<Vec<MemoryRow>, EnterpriseSyncError> {
+ Ok(Vec::new())
+ }
}
// ─── Wire types — what we POST upstream ─────────────────────────────────────
@@ -342,8 +360,33 @@ pub struct SnapshotRow {
pub height: u32,
}
+/// One memory row — a user- or AI-curated fact, preference, decision, or
+/// insight. The `memories` table is screenpipe's *distilled* layer above raw
+/// frame/audio — small (10s–1000s of rows), high-signal, and the unit of
+/// institutional knowledge that should follow a person across machines and
+/// (for enterprise) into the org's dashboard. Frame provenance is preserved
+/// via `frame_id` so downstream can link back to the source moment.
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
+pub struct MemoryRow {
+ /// Local DB id — stable across restarts of this device. Server dedups by
+ /// `(device_id, memory_id)`.
+ pub memory_id: i64,
+ /// RFC3339 UTC. Set when the memory was first created locally.
+ pub created_at: String,
+ /// RFC3339 UTC. Updated when the memory body/tags/importance change.
+ pub updated_at: String,
+ pub content: String,
+ /// "user" (manually saved) or the agent/source that wrote it.
+ pub source: String,
+ pub tags: Vec<String>,
+ /// 0.0 (trivial) – 1.0 (critical). Drives dashboard ranking.
+ pub importance: f64,
+ /// Optional link back to the frame this memory was distilled from.
+ pub frame_id: Option<i64>,
+}
+
/// One JSONL line. Tagged enum keeps mixed streams trivially parseable on the
-/// server side — `kind: "frame" | "audio" | "ui" | "snapshot"`.
+/// server side — `kind: "frame" | "audio" | "ui" | "snapshot" | "memory"`.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "kind", rename_all = "lowercase")]
pub enum TelemetryRecord {
@@ -371,6 +414,12 @@ pub enum TelemetryRecord {
#[serde(flatten)]
snapshot: SnapshotRow,
},
+ Memory {
+ device_id: String,
+ device_label: String,
+ #[serde(flatten)]
+ memory: MemoryRow,
+ },
}
// ─── Errors ─────────────────────────────────────────────────────────────────
@@ -393,8 +442,8 @@ pub enum EnterpriseSyncError {
// ─── Pure logic: build the JSONL payload ────────────────────────────────────
-/// Serialize a batch of frames + audio + UI rows + snapshots into JSONL
-/// bytes, tagged with the device's identity. Public for unit tests.
+/// Serialize a batch of frames + audio + UI rows + snapshots + memories into
+/// JSONL bytes, tagged with the device's identity. Public for unit tests.
pub fn build_jsonl(
device_id: &str,
device_label: &str,
@@ -402,9 +451,11 @@ pub fn build_jsonl(
audio: &[AudioRow],
ui: &[UiEventRow],
snapshots: &[SnapshotRow],
+ memories: &[MemoryRow],
) -> Vec<u8> {
let mut out = Vec::with_capacity(
- (frames.len() + audio.len() + ui.len()) * 256 + snapshots.len() * 50_000,
+ (frames.len() + audio.len() + ui.len() + memories.len()) * 256
+ + snapshots.len() * 50_000,
);
for f in frames {
let rec = TelemetryRecord::Frame {
@@ -483,6 +534,25 @@ pub fn build_jsonl(
}
}
}
+ for m in memories {
+ let rec = TelemetryRecord::Memory {
+ device_id: device_id.to_string(),
+ device_label: device_label.to_string(),
+ memory: m.clone(),
+ };
+ match serde_json::to_vec(&rec) {
+ Ok(line) => {
+ out.extend_from_slice(&line);
+ out.push(b'\n');
+ }
+ Err(e) => {
+ warn!(
+ "enterprise sync: failed to serialize memory {}: {}",
+ m.memory_id, e
+ );
+ }
+ }
+ }
out
}
@@ -551,6 +621,10 @@ pub async fn run_one_sync(
let cutoff = chrono::Utc::now() - chrono::Duration::from_std(SAFE_BACKFILL).unwrap();
cursor.last_ui_ts = Some(cutoff.to_rfc3339());
}
+ if cursor.last_memory_ts.is_none() {
+ let cutoff = chrono::Utc::now() - chrono::Duration::from_std(SAFE_BACKFILL).unwrap();
+ cursor.last_memory_ts = Some(cutoff.to_rfc3339());
+ }
let frames = local
.fetch_frames_since(cursor.last_frame_ts.as_deref(), PAGE_LIMIT)
@@ -581,16 +655,28 @@ pub async fn run_one_sync(
Vec::new()
}
};
+ // Memories are best-effort too — a client that predates the trait
+ // method, or a server without the /memories route, must not kill
+ // the frame+audio path. The default trait impl returns empty.
+ let memories = match local
+ .fetch_memories_since(cursor.last_memory_ts.as_deref(), PAGE_LIMIT)
+ .await
+ {
+ Ok(rows) => rows,
+ Err(e) => {
+ warn!("enterprise sync: memory fetch failed (skipping): {}", e);
+ Vec::new()
+ }
+ };
- if frames.is_empty() && audio.is_empty() && ui.is_empty() && snapshots.is_empty() {
+ if frames.is_empty()
+ && audio.is_empty()
+ && ui.is_empty()
+ && snapshots.is_empty()
+ && memories.is_empty()
+ {
debug!("enterprise sync: nothing new since last tick");
- return Ok(SyncTickReport {
- frames: 0,
- audio: 0,
- ui: 0,
- snapshots: 0,
- bytes: 0,
- });
+ return Ok(SyncTickReport::default());
}
let body = build_jsonl(
@@ -600,6 +686,7 @@ pub async fn run_one_sync(
&audio,
&ui,
&snapshots,
+ &memories,
);
let bytes = body.len();
@@ -613,6 +700,9 @@ pub async fn run_one_sync(
if let Some(latest) = ui.last() {
next_cursor.last_ui_ts = Some(latest.timestamp.clone());
}
+ if let Some(latest) = memories.last() {
+ next_cursor.last_memory_ts = Some(latest.created_at.clone());
+ }
match &cfg.upload_mode {
EnterpriseUploadMode::HostedIngest => {
@@ -624,6 +714,7 @@ pub async fn run_one_sync(
audio: audio.len(),
ui: ui.len(),
snapshots: snapshots.len(),
+ memories: memories.len(),
};
upload_direct_encrypted_batch(
http,
@@ -641,6 +732,7 @@ pub async fn run_one_sync(
audio: audio.len(),
ui: ui.len(),
snapshots: snapshots.len(),
+ memories: memories.len(),
};
upload_direct_readable_batch(
http,
@@ -663,6 +755,7 @@ pub async fn run_one_sync(
audio: audio.len(),
ui: ui.len(),
snapshots: snapshots.len(),
+ memories: memories.len(),
bytes,
})
}
@@ -673,6 +766,7 @@ pub struct SyncTickReport {
pub audio: usize,
pub ui: usize,
pub snapshots: usize,
+ pub memories: usize,
pub bytes: usize,
}
@@ -701,10 +795,20 @@ pub async fn run(
loop {
match run_one_sync(&cfg, &mut cursor, local.as_ref(), &http).await {
Ok(report) => {
- if report.frames > 0 || report.audio > 0 || report.ui > 0 || report.snapshots > 0 {
+ if report.frames > 0
+ || report.audio > 0
+ || report.ui > 0
+ || report.snapshots > 0
+ || report.memories > 0
+ {
info!(
- "enterprise sync: pushed {} frames, {} audio, {} ui, {} snapshots ({} bytes)",
- report.frames, report.audio, report.ui, report.snapshots, report.bytes
+ "enterprise sync: pushed {} frames, {} audio, {} ui, {} snapshots, {} memories ({} bytes)",
+ report.frames,
+ report.audio,
+ report.ui,
+ report.snapshots,
+ report.memories,
+ report.bytes
);
}
backoff = BACKOFF_INITIAL;
@@ -818,6 +922,19 @@ mod tests {
}
}
+ fn memory(id: i64, ts: &str, content: &str) -> MemoryRow {
+ MemoryRow {
+ memory_id: id,
+ created_at: ts.to_string(),
+ updated_at: ts.to_string(),
+ content: content.to_string(),
+ source: "user".to_string(),
+ tags: vec!["work".to_string()],
+ importance: 0.7,
+ frame_id: None,
+ }
+ }
+
#[test]
fn jsonl_one_line_per_record() {
let body = build_jsonl(
@@ -830,10 +947,11 @@ mod tests {
&[audio(1, "2026-05-07T10:00:15Z", "hi")],
&[ui_event(1, "2026-05-07T10:00:20Z", "Arc", "Send")],
&[snapshot(2, "2026-05-07T10:00:30Z")],
+ &[memory(7, "2026-05-07T10:00:40Z", "Acme deal closes June 1")],
);
let s = String::from_utf8(body).unwrap();
let lines: Vec<&str> = s.split('\n').filter(|l| !l.is_empty()).collect();
- assert_eq!(lines.len(), 5);
+ assert_eq!(lines.len(), 6);
for l in &lines {
let v: serde_json::Value = serde_json::from_str(l).unwrap();
assert!(v.get("kind").is_some(), "missing kind: {l}");
@@ -852,11 +970,12 @@ mod tests {
assert!(kinds.iter().any(|k| k == "audio"));
assert!(kinds.iter().any(|k| k == "ui"));
assert!(kinds.iter().any(|k| k == "snapshot"));
+ assert!(kinds.iter().any(|k| k == "memory"));
}
#[test]
fn jsonl_empty_input_yields_empty_body() {
- let body = build_jsonl("dev-1", "host", &[], &[], &[], &[]);
+ let body = build_jsonl("dev-1", "host", &[], &[], &[], &[], &[]);
assert!(body.is_empty());
}
@@ -872,6 +991,7 @@ mod tests {
&[],
&[],
&[],
+ &[],
);
let s = String::from_utf8(body).unwrap();
let first_line = s.lines().next().unwrap();
@@ -888,6 +1008,7 @@ mod tests {
&[],
&[],
&[snapshot(42, "2026-05-07T10:00:30Z")],
+ &[],
);
let s = String::from_utf8(body).unwrap();
let v: serde_json::Value = serde_json::from_str(s.lines().next().unwrap()).unwrap();
@@ -913,6 +1034,7 @@ mod tests {
"Submit Quote",
)],
&[],
+ &[],
);
let s = String::from_utf8(body).unwrap();
let v: serde_json::Value = serde_json::from_str(s.lines().next().unwrap()).unwrap();
@@ -921,6 +1043,34 @@ mod tests {
assert_eq!(v["app_name"], "Salesforce");
}
+ #[test]
+ fn jsonl_serializes_memories_with_all_fields() {
+ let body = build_jsonl(
+ "dev-1",
+ "louis-mbp",
+ &[],
+ &[],
+ &[],
+ &[],
+ &[memory(
+ 42,
+ "2026-05-07T10:01:00Z",
+ "Acme deal closes June 1",
+ )],
+ );
+ let s = String::from_utf8(body).unwrap();
+ let v: serde_json::Value = serde_json::from_str(s.lines().next().unwrap()).unwrap();
+ assert_eq!(v["kind"], "memory");
+ assert_eq!(v["memory_id"], 42);
+ assert_eq!(v["content"], "Acme deal closes June 1");
+ assert_eq!(v["source"], "user");
+ assert_eq!(v["importance"], 0.7);
+ assert_eq!(v["tags"], serde_json::json!(["work"]));
+ // Frame provenance is preserved as null when absent — server can still
+ // index the memory standalone.
+ assert!(v.get("frame_id").is_some());
+ }
+
// ─── Cursor ─────────────────────────────────────────────────────────
#[test]
@@ -948,6 +1098,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T10:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:30:00Z".to_string()),
+ last_memory_ts: Some("2026-05-07T09:15:00Z".to_string()),
};
c.save(&p).unwrap();
let loaded = Cursor::load(&p);
@@ -964,6 +1115,7 @@ mod tests {
last_frame_ts: Some("t".to_string()),
last_audio_ts: None,
last_ui_ts: None,
+ last_memory_ts: None,
}
.save(&p)
.unwrap();
@@ -1170,8 +1322,10 @@ mod tests {
struct MockLocal {
frames_to_yield: Mutex<Vec<Vec<FrameRow>>>,
audio_to_yield: Mutex<Vec<Vec<AudioRow>>>,
+ memories_to_yield: Mutex<Vec<Vec<MemoryRow>>>,
last_frames_since: Mutex<Option<String>>,
last_audio_since: Mutex<Option<String>>,
+ last_memories_since: Mutex<Option<String>>,
}
impl MockLocal {
@@ -1179,10 +1333,17 @@ mod tests {
Self {
frames_to_yield: Mutex::new(frames),
audio_to_yield: Mutex::new(audio),
+ memories_to_yield: Mutex::new(Vec::new()),
last_frames_since: Mutex::new(None),
last_audio_since: Mutex::new(None),
+ last_memories_since: Mutex::new(None),
}
}
+
+ fn with_memories(mut self, memories: Vec<Vec<MemoryRow>>) -> Self {
+ self.memories_to_yield = Mutex::new(memories);
+ self
+ }
}
#[async_trait::async_trait]
@@ -1214,6 +1375,20 @@ mod tests {
.pop()
.unwrap_or_default())
}
+
+ async fn fetch_memories_since(
+ &self,
+ since_ts: Option<&str>,
+ _limit: u32,
+ ) -> Result<Vec<MemoryRow>, EnterpriseSyncError> {
+ *self.last_memories_since.lock().unwrap() = since_ts.map(|s| s.to_string());
+ Ok(self
+ .memories_to_yield
+ .lock()
+ .unwrap()
+ .pop()
+ .unwrap_or_default())
+ }
}
fn test_cfg(dir: &TempDir, ingest_url: String) -> EnterpriseSyncConfig {
@@ -1276,6 +1451,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T10:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T10:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T10:00:00Z".to_string()),
+ last_memory_ts: Some("2026-05-07T10:00:00Z".to_string()),
};
let local = MockLocal::new(vec![vec![]], vec![vec![]]);
let http = reqwest::Client::new();
@@ -1328,6 +1504,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![
@@ -1355,6 +1532,53 @@ mod tests {
assert_eq!(loaded.last_frame_ts, cursor.last_frame_ts);
}
+ #[tokio::test]
+ async fn memories_advance_their_own_cursor() {
+ // Memory-only batch — no frame/audio activity. The tick should still
+ // POST and advance `last_memory_ts` to the latest memory's created_at.
+ // This is the load-bearing path for enterprise: an idle user who just
+ // saves "remember the Acme deal closes June 1" should produce upstream
+ // signal even if their screen and mic are silent.
+ let server = wiremock::MockServer::start().await;
+ wiremock::Mock::given(wiremock::matchers::method("POST"))
+ .and(wiremock::matchers::header("X-License-Key", "sek_test"))
+ .respond_with(wiremock::ResponseTemplate::new(200))
+ .mount(&server)
+ .await;
+
+ let dir = TempDir::new().unwrap();
+ let cfg = test_cfg(&dir, format!("{}/ingest", server.uri()));
+ let mut cursor = Cursor {
+ last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ };
+ let local = MockLocal::new(vec![vec![]], vec![vec![]]).with_memories(vec![vec![
+ memory(1, "2026-05-07T10:00:00Z", "first"),
+ memory(2, "2026-05-07T10:30:00Z", "second"),
+ ]]);
+ let http = reqwest::Client::new();
+ let report = run_one_sync(&cfg, &mut cursor, &local, &http)
+ .await
+ .unwrap();
+ assert_eq!(report.frames, 0);
+ assert_eq!(report.audio, 0);
+ assert_eq!(report.memories, 2);
+ assert_eq!(
+ cursor.last_memory_ts.as_deref(),
+ Some("2026-05-07T10:30:00Z")
+ );
+ // Non-memory cursors are untouched when there's no activity on those
+ // streams.
+ assert_eq!(
+ cursor.last_frame_ts.as_deref(),
+ Some("2026-05-07T09:00:00Z")
+ );
+ let loaded = Cursor::load(&cfg.cursor_path);
+ assert_eq!(loaded.last_memory_ts, cursor.last_memory_ts);
+ }
+
#[tokio::test]
async fn direct_upload_success_advances_cursor_after_complete() {
let server = wiremock::MockServer::start().await;
@@ -1399,6 +1623,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![frame(1, "2026-05-07T10:00:00Z", "Arc", "secret")]],
@@ -1469,6 +1694,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![frame(
@@ -1530,6 +1756,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![frame(1, "2026-05-07T10:00:00Z", "Arc", "secret")]],
@@ -1562,6 +1789,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![frame(1, "2026-05-07T10:00:00Z", "Arc", "x")]],
@@ -1593,6 +1821,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![frame(1, "2026-05-07T10:00:00Z", "Arc", "x")]],
@@ -1630,6 +1859,7 @@ mod tests {
last_frame_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_audio_ts: Some("2026-05-07T09:00:00Z".to_string()),
last_ui_ts: Some("2026-05-07T09:00:00Z".to_string()),
+ last_memory_ts: None,
};
let local = MockLocal::new(
vec![vec![frame(1, "2026-05-07T10:00:00Z", "Arc", "x")]],
diff --git a/ee/desktop-rust/enterprise_upload.rs b/ee/desktop-rust/enterprise_upload.rs
index 43d7c48fe..02d55fc6f 100644
--- a/ee/desktop-rust/enterprise_upload.rs
+++ b/ee/desktop-rust/enterprise_upload.rs
@@ -339,6 +339,8 @@ pub struct DirectUploadRecordCounts {
pub audio: usize,
pub ui: usize,
pub snapshots: usize,
+ #[serde(default)]
+ pub memories: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
@@ -346,6 +348,8 @@ pub struct DirectUploadCursors {
pub last_frame_ts: Option<String>,
pub last_audio_ts: Option<String>,
pub last_ui_ts: Option<String>,
+ #[serde(default)]
+ pub last_memory_ts: Option<String>,
}
impl DirectUploadCursors {
@@ -354,6 +358,7 @@ impl DirectUploadCursors {
last_frame_ts: cursor.last_frame_ts.clone(),
last_audio_ts: cursor.last_audio_ts.clone(),
last_ui_ts: cursor.last_ui_ts.clone(),
+ last_memory_ts: cursor.last_memory_ts.clone(),
}
}
}
@@ -731,12 +736,14 @@ mod tests {
last_frame_ts: Some("2026-05-13T18:00:00Z".to_string()),
last_audio_ts: None,
last_ui_ts: None,
+ last_memory_ts: None,
};
let counts = DirectUploadRecordCounts {
frames: 1,
audio: 0,
ui: 0,
snapshots: 0,
+ memories: 0,
};
let batch =
@@ -811,11 +818,13 @@ mod tests {
audio: 0,
ui: 0,
snapshots: 0,
+ memories: 0,
};
let cursors = DirectUploadCursors {
last_frame_ts: Some("2026-05-13T18:00:00Z".to_string()),
last_audio_ts: None,
last_ui_ts: None,
+ last_memory_ts: None,
};
let a =
@@ -836,11 +845,13 @@ mod tests {
audio: 0,
ui: 0,
snapshots: 0,
+ memories: 0,
};
let cursors = DirectUploadCursors {
last_frame_ts: Some("2026-05-13T18:00:00Z".to_string()),
last_audio_ts: None,
last_ui_ts: None,
+ last_memory_ts: None,
};
let manifest =