@@ -179,8 +179,10 @@ export async function getRecentFirebotReleases(): Promise<IRelease[] | null> {
179179
180180export interface SupportedVersions {
181181 currentStable : string | null ;
182- previousStable : string | null ;
183- previousStableExpiresAt : number | null ;
182+ previousStables : Array < {
183+ version : string ;
184+ expiresAt : number ;
185+ } > ;
184186 prerelease : string | null ;
185187}
186188
@@ -189,8 +191,7 @@ export async function getSupportedFirebotVersions(): Promise<SupportedVersions>
189191
190192 const result : SupportedVersions = {
191193 currentStable : null ,
192- previousStable : null ,
193- previousStableExpiresAt : null ,
194+ previousStables : [ ] ,
194195 prerelease : null ,
195196 } ;
196197
@@ -208,7 +209,7 @@ export async function getSupportedFirebotVersions(): Promise<SupportedVersions>
208209 if ( stableReleases . length > 0 ) {
209210 result . currentStable = stableReleases [ 0 ] . tag_name ;
210211
211- // Check if previous stable should still be supported (within 30 days of current stable release)
212+ // Check if previous stable(s) should still be supported (within 30 days of current stable release)
212213 if ( stableReleases . length > 1 ) {
213214 const currentStableDate = new Date ( stableReleases [ 0 ] . published_at ) ;
214215 const now = new Date ( ) ;
@@ -218,14 +219,28 @@ export async function getSupportedFirebotVersions(): Promise<SupportedVersions>
218219 ) ;
219220
220221 if ( daysSinceCurrentStable <= 30 ) {
221- result . previousStable = stableReleases [ 1 ] . tag_name ;
222- // Calculate expiration date (30 days from current stable release)
223- const expirationDate = new Date (
224- currentStableDate . getTime ( ) + 30 * 24 * 60 * 60 * 1000
225- ) ;
226- result . previousStableExpiresAt = Math . floor (
227- expirationDate . getTime ( ) / 1000
228- ) ;
222+ let supersedingReleaseDate = currentStableDate ;
223+ let daysSinceSupersedingUpdate : number ;
224+
225+ for ( const previousStable of stableReleases . slice ( 1 ) ) {
226+ // Calculate how long since release has been superseded
227+ daysSinceSupersedingUpdate = ( supersedingReleaseDate . getTime ( ) - new Date ( previousStable . published_at ) . getTime ( ) ) / ( 1000 * 60 * 60 * 24 ) ;
228+
229+ // If it's been more than 30 days since this release was superseded, we're done. Everything remaining is older.
230+ if ( daysSinceSupersedingUpdate > 30 ) {
231+ break ;
232+ }
233+
234+ // Calculate expiration date (30 days from superseding stable release)
235+ const expirationDate = new Date ( supersedingReleaseDate . getTime ( ) + ( 30 * 24 * 60 * 60 * 1000 ) ) ;
236+
237+ result . previousStables . push ( {
238+ version : previousStable . tag_name ,
239+ expiresAt : Math . floor ( expirationDate . getTime ( ) / 1000 )
240+ } ) ;
241+
242+ supersedingReleaseDate = new Date ( previousStable . published_at ) ;
243+ }
229244 }
230245 }
231246 }
@@ -257,13 +272,12 @@ export async function getSupportedFirebotVersionField(): Promise<APIEmbedField |
257272 if ( supportedVersions . currentStable ) {
258273 versionLines . push ( `- **${ supportedVersions . currentStable } ** (Latest)` ) ;
259274 }
260- if (
261- supportedVersions . previousStable &&
262- supportedVersions . previousStableExpiresAt
263- ) {
264- versionLines . push (
265- `- **${ supportedVersions . previousStable } ** (Previous - support expires <t:${ supportedVersions . previousStableExpiresAt } :R>)`
266- ) ;
275+ if ( supportedVersions . previousStables . length ) {
276+ for ( const previousStable of supportedVersions . previousStables ) {
277+ versionLines . push (
278+ `- **${ previousStable . version } ** (Previous - support expires <t:${ previousStable . expiresAt } :R>)`
279+ ) ;
280+ }
267281 }
268282 if ( supportedVersions . prerelease ) {
269283 versionLines . push (
0 commit comments