Commit b0b7d39
committed
markets/: key the position rebuild on your own holdings
The in-place updater refreshed the derived numbers but never the text
that only your OWN trade changes: the per-row 'risked X to returns Y if
right' meta and the 'you hold N to win' line on the outcome buttons.
Betting again on something you already held left the card contradicting
itself -- a stated stake of 226.00 beside a P&L computed from the real
276, and a footer whose total didn't match the rows it sat under. It
never self-healed; only a reload rebuilt it.
The shape key now includes the user's own share balances. A third
party's trade leaves those untouched, so the cheap focus-preserving path
still runs for price ticks -- which is what it was for -- while your own
bet forces the rebuild that rewrites the stake and payout text.
Verified both halves against a real second agent (a bearer with
credentials:'omit', since the session cookie otherwise takes
precedence): carol's trade keeps the shape, keeps focus on the same
Cash out node, and tracks the server P&L to the cent; alice's own bet
rebuilds and the meta matches /api/me exactly.
75 plugin tests green.1 parent 6756b95 commit b0b7d39
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
948 | 948 | | |
949 | 949 | | |
950 | 950 | | |
951 | | - | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
952 | 954 | | |
953 | 955 | | |
954 | 956 | | |
| |||
957 | 959 | | |
958 | 960 | | |
959 | 961 | | |
960 | | - | |
| 962 | + | |
961 | 963 | | |
962 | 964 | | |
963 | 965 | | |
| |||
1043 | 1045 | | |
1044 | 1046 | | |
1045 | 1047 | | |
1046 | | - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1047 | 1053 | | |
1048 | 1054 | | |
1049 | 1055 | | |
| |||
0 commit comments