Prefer richer synced state

This commit is contained in:
Theodore Song
2026-07-05 22:33:32 -04:00
parent 8cf22d86e8
commit a0cafabaf1
+1 -4
View File
@@ -596,10 +596,7 @@ function cloudShouldReplaceLocal(cloud,local){
const remote=stateFromSyncItems(cloud&&cloud.items);
if(!remote)return false;
const remoteDepth=stateDepth(remote), localDepth=stateDepth(local);
if(remoteDepth!==localDepth)return remoteDepth>localDepth;
const remoteTime=Date.parse(remote.last_run||cloud.updated_at||0)||0;
const localTime=Date.parse(local&&local.last_run||0)||0;
return remoteTime>localTime;
return remoteDepth>localDepth;
}
async function pushCloudState(){
try{