New structure

This commit is contained in:
2025-11-11 12:59:42 +01:00
parent 088a3a024f
commit 89bc226d6b
46 changed files with 990 additions and 944 deletions

View File

@@ -0,0 +1,26 @@
export class MobileRetryTracker {
private attempts = 0
private readonly maxRetries: number
constructor(maxRetries: number) {
const normalized = Number.isFinite(maxRetries) ? Math.floor(maxRetries) : 0
this.maxRetries = Math.max(0, normalized)
}
/**
* Register an incomplete mobile search attempt.
* @returns true when another retry should be attempted, false when the retry budget is exhausted.
*/
registerFailure(): boolean {
this.attempts += 1
return this.attempts <= this.maxRetries
}
hasExceeded(): boolean {
return this.attempts > this.maxRetries
}
getAttemptCount(): number {
return this.attempts
}
}