(root)/ – Rev 37437
Rev 37436 |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 37437 2026-08-27 06:25:11
- Author: amit
- Log message:
- Oppo: derive the drag ratio from every move, and survive a stale slider
Two changes, both oppo only. Realme is converting 82% and is left alone.
1. No assumed ratio -- aim() is a closed loop.
ASSUMED_RATIO only ever sized the FIRST probe, but the old path then derived
px-per-px once from that single probe and trusted it for the main move and the
correction alike. refine() re-measured the gap but reused the same ratio and
never checked whether its own correction landed, so one noisy probe poisoned
everything after it.
aim() seeds with a small fixed 12px nudge -- small enough that it cannot cross
the hole -- then re-derives the ratio from what each move actually achieved and
blends it with the running estimate. Up to 5 steps, stopping as soon as the gap
is within ALIGNED_PX.
It can also see overshoot, which a single pass cannot: the gap is |c1 - c2| and
cannot tell "not there yet" from "gone past", but if a move makes the gap GROW
we have crossed the hole, and the next step flips sign.
This removes the constant rather than retuning it, so it is immune to the scale
differences we measured between environments -- 1.1-1.2 px per px locally
against 0.67-0.86 in production. Supersedes r37433 and r37436 for oppo.
calibrate(), refine() and nudgeFor() are now dead and removed.
2. Re-find the slider when it goes stale instead of dropping the imei.
54 of 284 oppo presses (19%) died on StaleElementReferenceException, against 0
of 90 on realme -- the first asymmetry found between the two. Every one aborted
the attempt and forced a full page reload.
The logs place it exactly: "Margin Left before-" succeeds, then the catch fires,
so the handle goes stale between that read and moveToElement. It happens on
retry iterations (before- 4px, 1px), right after the doubleClick refresh swaps
the widget DOM -- the element found at the top of the attempt is already
detached by the time we act on it.
Now re-finds and retries once. The margin-left reads are also wrapped: they are
diagnostics and must never be the reason an attempt is abandoned.
Neither change is verified in production yet. The stale fix is the one with a
measured asymmetry behind it; aim() is a design fix for a mechanism that was
provably fragile, not a fix for a measured cause of oppo's 13%.