Commit 690494b
smc: gate arc draws on origin coords + accurate event type doc
Four Copilot findings:
1. replayCurrentPeers fired before _initOrigin completed — replayed
arcs drew to GlobeCoordinates(0,0) and never got corrected.
Moved the replay call into _initOrigin's continuation so it
runs only AFTER origin coords are known.
2. _addPeer fell back to GlobeCoordinates(0,0) when _originCoords
hadn't loaded yet, so real-time +1 events arriving during the
origin-lookup window could still draw to (0,0). Added a null
guard: if origin isn't resolved, skip the draw — the peer is
still tracked in the notifier's _peerArcs map (source of
truth), and replayCurrentPeers in _initOrigin's continuation
picks it up.
Reordered initState: subscribe FIRST so real-time events
accumulate in _peerArcs while origin is loading, then call
_initOrigin which finishes by calling replayCurrentPeers.
With both changes there's no window where a peer is drawn
without correct origin coords.
3. debugPrint comment claimed it 'avoids bringing in the
appLogger' and that 'real impl can switch to slog' — but the
file already uses appLogger, and slog isn't a Dart logger.
Rewrote to describe the actual rationale: avoid escalating a
single malformed wire event to a user-visible error toast in
debug builds; keep the listener subscribed so subsequent
well-formed events still arrive.
4. lantern-core's EventTypePeerConnection doc described it as
samizdat-only with a {state, source} payload. Both donor
protocols now emit on this event type with the unified
{state, source, timestamp} payload (peer-share's marshal was
bumped in the previous round to include timestamp). Updated
the doc accordingly with source-format details for both
protocols.
dart analyze clean; Go build clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 24abae2 commit 690494b
2 files changed
Lines changed: 35 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
Lines changed: 26 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
473 | 477 | | |
474 | 478 | | |
475 | 479 | | |
| |||
854 | 858 | | |
855 | 859 | | |
856 | 860 | | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
862 | 868 | | |
863 | 869 | | |
864 | 870 | | |
865 | 871 | | |
866 | | - | |
| 872 | + | |
867 | 873 | | |
868 | 874 | | |
869 | 875 | | |
| |||
897 | 903 | | |
898 | 904 | | |
899 | 905 | | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
900 | 911 | | |
901 | 912 | | |
902 | 913 | | |
| |||
928 | 939 | | |
929 | 940 | | |
930 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
931 | 948 | | |
932 | 949 | | |
933 | 950 | | |
934 | 951 | | |
935 | 952 | | |
936 | 953 | | |
937 | 954 | | |
938 | | - | |
| 955 | + | |
939 | 956 | | |
940 | 957 | | |
941 | 958 | | |
| |||
0 commit comments