From 90a7912ad25a60d8ca6c12b37623d45d1dd011df Mon Sep 17 00:00:00 2001 From: Olivier Booklage Date: Sat, 31 Oct 2026 14:03:54 +0100 Subject: [PATCH] fix(companion): Never move the clock back at boot bootstrapRTCfromContacts() set the clock to the latest contact time even when the RTC backup had already restored the right time, so every reboot put the clock back to the last advert heard. --- src/helpers/BaseChatMesh.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helpers/BaseChatMesh.cpp b/src/helpers/BaseChatMesh.cpp index 4368d17f1c2..ed9944292e8 100644 --- a/src/helpers/BaseChatMesh.cpp +++ b/src/helpers/BaseChatMesh.cpp @@ -64,7 +64,8 @@ void BaseChatMesh::bootstrapRTCfromContacts() { latest = contacts[i].lastmod; } } - if (latest != 0) { + // only move the clock forward: it may already be right (RTC backup, RTC chip) + if (latest != 0 && latest + 1 > getRTCClock()->getCurrentTime()) { getRTCClock()->setCurrentTime(latest + 1); } }