You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Issue:** When low usage mode is enabled, stats on the home page sometimes display incorrect numbers (showing old/cached values instead of current stats).
@@ -12,7 +32,6 @@
12
32
13
33
**Files Modified:**
14
34
-`frontend/static/js/new-main.js` - Added low usage mode detection, fixed initialization order, and improved state detection
**Issue:** When Docker container starts/restarts, countdown timers show "Error Loading" initially, which is confusing to users since it's not actually an error - the timer is just waiting for the first app cycle to complete so it can calculate the next cycle time.
**Issue:** When pressing the reset button on countdown timers, "Refreshing" message only stays for about 1 second then disappears, which is misleading because the actual reset process takes much longer (the app needs to complete a full cycle before new timer data is available).
98
+
**Root Cause:** The reset button logic was using a simple 2-second timeout before fetching new data, but the actual reset process can take several minutes depending on the app's cycle duration.
99
+
100
+
**Solution:**
101
+
1. Implemented intelligent polling system that keeps "Refreshing" displayed until actual new timer data is available
102
+
2. Added `data-waiting-for-reset` attribute to track timers waiting for reset data
103
+
3. Modified `updateTimerDisplay()` to respect the waiting state and not override "Refreshing" message
104
+
4. Added `startResetPolling()` function that polls every 5 seconds for up to 5 minutes
105
+
5.**CRITICAL FIX**: Store original cycle time before reset and only consider reset complete when receiving a *different* cycle time
106
+
6. Only removes "Refreshing" when genuinely new countdown data is received (not just the same old data)
107
+
108
+
**Files Modified:**
109
+
-`frontend/static/js/cycle-countdown.js` - Improved reset button behavior and polling logic
110
+
-`.github/listen.MD` - Added guidance to not update version numbers automatically
111
+
112
+
**Code Changes:**
113
+
```javascript
114
+
// Before: Simple timeout that was misleading
115
+
setTimeout(() => {
116
+
fetchFromSleepJson();
117
+
}, 2000);
118
+
119
+
// After: Intelligent polling that waits for genuinely new data
console.log('Same cycle time, continuing to poll for new data');
136
+
}
137
+
}
138
+
});
139
+
}, 5000); // Poll every 5 seconds
140
+
}
141
+
```
142
+
143
+
**User Experience:** Users now see "Refreshing" for the appropriate duration until the reset process actually completes and new countdown data is available, providing accurate feedback about the system state.
0 commit comments