v1.6.3
Bot Manager — Auto-refreshing "NEW RELEASE!" banner
🇬🇧 English
Why
The GitHub release check only ran once at startup (Main.cs:367). If a new version was published while the app was open, the "NEW RELEASE!" banner stayed hidden until the user closed and reopened the program.
What changed
- Background polling timer. A
System.Threading.Timernow re-queries the GitHub Releases API every 1 hour while the app is open, in addition to the existing startup check. The interval is exposed as a single constant (UpdateCheckInterval) so it's trivial to tune. - Banner appears live. When the periodic check detects a newer version, the result is marshalled to the UI thread via
BeginInvokeand the banner animates in without requiring a restart. - Per-version dedupe. Added
_lastSeenUpdateVersion. Even though the timer fires 24× per day,SetUpdateNotification(...)is only invoked once per new release detected at runtime — no spammy re-animations. - No surprise modals. The background call now passes
showDialog: falsetoUpdateChecker.CheckForUpdatesAsync(...), so polling can never pop up an update dialog. The manual "Update" button still usesforceShow: trueand behaves exactly as before. - Clean shutdown. Timer is disposed on
FormClosedand anIsDisposedguard sits inside the callback as a belt-and-braces measure against late callbacks against a disposed UI.
Rate-limit safety
GitHub's unauthenticated API allows 60 requests/hour per IP. One request per hour per running instance is 1 req/hour — comfortably under the limit.
How to verify
- Open the app.
- Publish a new release on GitHub (or lower
TradeBot.Versionlocally to force the check to find something newer). - Within ≤ 1 hour the "NEW RELEASE!" banner appears on its own. No restart needed.
🇪🇸 Español
Por qué
El check de releases en GitHub se ejecutaba una sola vez al arrancar (Main.cs:367). Si publicabas una versión nueva con la app abierta, el banner "NEW RELEASE!" quedaba oculto hasta que el usuario cerrara y reabriera el programa.
Qué cambió
- Timer de polling en background. Un
System.Threading.Timervuelve a consultar la API de GitHub Releases cada 1 hora mientras la app está abierta, además del check inicial al arrancar. El intervalo está expuesto como una constante (UpdateCheckInterval) para que sea trivial ajustarlo. - El banner aparece en vivo. Cuando el check periódico detecta una versión más reciente, el resultado se envía al hilo UI vía
BeginInvokey el banner se anima sin necesidad de reiniciar. - Dedupe por versión. Añadido
_lastSeenUpdateVersion. Aunque el timer dispare 24 veces al día,SetUpdateNotification(...)solo se invoca una vez por release nuevo detectado en runtime — sin re-animaciones spammy. - Sin diálogos por sorpresa. La llamada en background ahora pasa
showDialog: falseaUpdateChecker.CheckForUpdatesAsync(...), así que el polling jamás abre una ventana modal. El botón manual de "Update" sigue usandoforceShow: truey se comporta exactamente igual que antes. - Shutdown limpio. El timer se libera en
FormClosedy un guardIsDisposeddentro del callback funciona como red de seguridad contra callbacks tardíos sobre una UI ya disposed.
Seguridad de rate-limits
La API pública de GitHub permite 60 requests/hora por IP sin autenticar. Una request por hora por instancia = 1 req/hora — cómodamente por debajo del límite.
Cómo verificarlo
- Abre la app.
- Publica un release nuevo en GitHub (o baja
TradeBot.Versionlocalmente para forzar que el check encuentre algo más nuevo). - En ≤ 1 hora el banner "NEW RELEASE!" aparece solo. Sin reiniciar.