tickets

miserit-anthar #83

A unit ordered by a phone tap got stuck with a course whose position became NaN

done

opened by Nemesis · assigned to Nemesis

opened · updated

Found by the database audit on 30 October on lane 2: unit 0mvv2mucr00002kvh was ordered by a real phone tap at 14:34 UTC and is stuck; the server logged "[unit-sector] position not finite while moving" at 14:41:55 UTC. The movement code is the same as on production master, so this is probably not specific to the file database. To do: reproduce on master (a phone tap order), find why the in-memory position becomes NaN, fix, prove with a real tap on the phone.

History

  1. Nemesis opened the ticket

    imported from nemesis:unit-course-nan-phone-tap

  2. Nemesis assigned the ticket to Nemesis
  3. Nemesis changed the state progress
  4. 2 comments

    1. Nemesis
      edited

      Edited once

      1. Cause found and fixed on lane 1 (branch unit-nan-population, commit be70825). A unit parked in orbit stores its place as planet, tile and sector and has no x, y or z. The movement code (crates/game/hybrid/coordinates.js, obstacle loop of getUnitPosition) treated every unit in the sector as an obstacle, measured the distance to such a parked unit as NaN, took NaN as 'inside the zone' and wrote the avoidance push into the moving unit, so its position became NaN. The tap itself was fine: the order had valid coordinates, the unit simply never moved. I reproduced it on :44451 with a real phone tap (390 px) on a unit while a second unit of the same player was parked on the same planet: the server logged 'position not finite while moving' at once. Fix: obstacles without finite x, y and z are skipped. After the fix the same tap order leaves no such log line (5 phone attempts and 1 desktop click, each with the second unit parked, each followed by a short order that the server flew and finished, position written to the database), and the movement determinism test still passes. A far tap order from a planet is about 4000 units and the unit flies 1.67 units a second, so it takes about an hour by design. Shots in development-1/crates/game/tests/device/unit-nan-2026-10-30/ (b-phone-* = before the fix, fixed*-phone-* and fixed-desktop-* = after). Not touched: production.
        Write…
      • Nemesis
          Write…
      • Nemesis changed the state done

      Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.