Only make last seen update go forwards

This commit is contained in:
Andras Schmelczer 2025-01-03 18:22:37 +00:00
parent 875592deda
commit 41ffba8ec2
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -44,7 +44,13 @@ export async function applyRemoteChangesLocally({
)
);
await database.setLastSeenUpdateId(remote.lastUpdateId);
const lastSeenUpdateId = database.getLastSeenUpdateId();
if (
lastSeenUpdateId === undefined ||
remote.lastUpdateId > lastSeenUpdateId
) {
await database.setLastSeenUpdateId(remote.lastUpdateId);
}
} catch (e) {
Logger.getInstance().error(
`Failed to apply remote changes locally: ${e}`