Commit 56a8cf4
committed
Support fresh weekly reset activation flow
Add detection and activation flow for fresh weekly resets. Introduces shouldActivateFreshWeeklyReset(account:usage:now:) to determine eligibility (checks feature toggle, auth state, future weeklyResetAt, not already attempted, and >=99.5% remaining). Use it to show a "Fresh weekly reset detected. Activation pending." indicator, to trigger immediate runWeeklyAutoKickAttempt (with pause/retry handling), and to adjust scheduling logic. Adds unit tests to assert the pending indicator behavior and updates test helpers (makeAccount signature and a new makeUsage helper).1 parent 4a4ba07 commit 56a8cf4
2 files changed
Lines changed: 104 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
983 | 991 | | |
984 | 992 | | |
985 | 993 | | |
| |||
1072 | 1080 | | |
1073 | 1081 | | |
1074 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1075 | 1094 | | |
1076 | 1095 | | |
1077 | 1096 | | |
| |||
1124 | 1143 | | |
1125 | 1144 | | |
1126 | 1145 | | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
1127 | 1168 | | |
1128 | 1169 | | |
1129 | 1170 | | |
| |||
1267 | 1308 | | |
1268 | 1309 | | |
1269 | 1310 | | |
1270 | | - | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1271 | 1314 | | |
1272 | 1315 | | |
1273 | 1316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
137 | 173 | | |
138 | 174 | | |
139 | 175 | | |
| |||
189 | 225 | | |
190 | 226 | | |
191 | 227 | | |
192 | | - | |
| 228 | + | |
| 229 | + | |
193 | 230 | | |
194 | 231 | | |
195 | 232 | | |
| |||
205 | 242 | | |
206 | 243 | | |
207 | 244 | | |
208 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
209 | 267 | | |
210 | 268 | | |
211 | 269 | | |
| |||
0 commit comments