Commit 6756b95
committed
markets/: stop the in-place updater clobbering its own hooks
The fix that kept Cash out focusable destroyed the class hooks it needed
to work. Assigning d.className = 'pnl up' dropped the v-pnl marker, so
the NEXT tick threw a TypeError, aborted renderDetail mid-loop, and left
every P&L figure and the cost/value footer frozen while the first leg
kept moving -- the UI read -158.10 against a server value of -166.31,
and the stale shape survived navigation so only a full page load healed
it. Two bets ten seconds apart were enough to trigger it, and the raw
TypeError was painted into the ticket beside the receipt.
Worse, the early return also skipped quote(), so an armed confirmation
slip never re-priced: it advertised 'Returns 95.41 at 4.77' with a live
Confirm and a running clock while the fill came back 27.91. maxCost does
not guard that -- the cost is what you typed; it is the return that
collapses.
Classes are now toggled rather than assigned, the in-place path is
null-guarded and falls back to a full rebuild instead of throwing, and
the whole render pass continues so the oracle and dispute cards
re-evaluate and the ticket re-prices. Verified: two bets in a row leave
the hooks intact with no errors and the P&L matching the server to the
cent, and a third party's trade re-prices an armed slip from 72.86 to
33.08 instead of holding a stale promise.
Also: the stale position shape is reset on route change, a websocket
render failure can no longer reach the ticket as a raw string, and the
previous market's wording is cleared from the hidden slip.
75 plugin tests green.1 parent 116cf78 commit 6756b95
1 file changed
Lines changed: 35 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1047 | 1057 | | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1058 | 1070 | | |
1059 | | - | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
1060 | 1077 | | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | 1078 | | |
| 1079 | + | |
1065 | 1080 | | |
1066 | 1081 | | |
1067 | 1082 | | |
| |||
1083 | 1098 | | |
1084 | 1099 | | |
1085 | 1100 | | |
| 1101 | + | |
1086 | 1102 | | |
1087 | 1103 | | |
1088 | 1104 | | |
| |||
1196 | 1212 | | |
1197 | 1213 | | |
1198 | 1214 | | |
| 1215 | + | |
1199 | 1216 | | |
1200 | 1217 | | |
1201 | 1218 | | |
| |||
1307 | 1324 | | |
1308 | 1325 | | |
1309 | 1326 | | |
| 1327 | + | |
1310 | 1328 | | |
1311 | 1329 | | |
1312 | 1330 | | |
| |||
1467 | 1485 | | |
1468 | 1486 | | |
1469 | 1487 | | |
1470 | | - | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
1471 | 1491 | | |
1472 | 1492 | | |
1473 | 1493 | | |
| |||
0 commit comments