Skip to content

[Bug]: Why Use of Magic Numbers ? #22745

Closed as not planned
Closed as not planned

Description

@agsb

Summary

HI All,

In A2UIHandler, the use of magic numbers 50 and 120 must be changed into parameters. the can be scaled

suspend fun ensureA2uiReady(a2uiUrl: String): Boolean {
try {
val already = canvas.eval(a2uiReadyCheckJS)
if (already == "true") return true
} catch (_: Throwable) {
// ignore
}

canvas.navigate(a2uiUrl)
repeat(50) {
  try {
    val ready = canvas.eval(a2uiReadyCheckJS)
    if (ready == "true") return true
  } catch (_: Throwable) {
    // ignore
  }
  delay(120)
}
return false

}

Steps to reproduce

No need of case, is obvious

Expected behavior

have parameters as NumberOfTries and DelayToWait

Actual behavior

Using two magic arbitrary fixed numbers that can not be good for all

OpenClaw version

last one

Operating system

Any OS

Install method

in android

Logs, screenshots, and evidence

No need, just look the code

Impact and severity

Every one is affected

Additional information

No response

Activity

  1. added
    bug
    on Feb 21, 2026
  2. openclaw-barnacle commented on Mar 1, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  3. added
    stale
    on Mar 1, 2026
  4. openclaw-barnacle commented on Mar 20, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh repro steps.

  5. locked as resolved and limited conversation to collaborators on Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions