Commit 24abae2
smc: MediaQuery copyWith + symmetric wire format + drop stale fromJson
Three Copilot findings:
1. _GlobeView wrapped its body in MediaQuery(data: MediaQueryData(size:
widgetSize), ...) — constructing MediaQueryData from scratch drops
inherited fields (devicePixelRatio, textScaleFactor, padding,
viewInsets, etc.). On high-DPI displays the pixel ratio fell to
1.0, breaking globe rendering crispness; accessibility scaling
for any descendants would also break. Switched to
MediaQuery.of(context).copyWith(size: widgetSize) which keeps
the inherited fields and only overrides what we need.
2. lantern-core/core.go's doc comment said the peer-connection wire
payload was always {state, source, timestamp}, but the
peer.ConnectionEvent marshal block emitted only {state, source}.
Added timestamp to the peer marshal (both peer.ConnectionEvent
and unbounded.ConnectionEvent carry Timestamp on the radiance
side, so the consumer-facing shape is now symmetric) and
updated the comment to spell out the source format difference
between protocols and call out Unix-millis for timestamp.
3. UnboundedConnectionEvent.fromJson was stale: it expected
{workerIdx, addr} keys, but the actual wire format is
{state, source, timestamp}. The factory is never called from
anywhere in lib/ — wire-format parsing happens inline in
share_my_connection.dart, and the class is only constructed
directly by the notifier as an internal Dart-side event model.
Dropped the dead factory and clarified the class docstring to
distinguish 'internal Dart-side model' from 'wire format',
including a note that workerIdx is a Dart-side identity
counter (_workerSeq), not the broflake worker index.
dart analyze clean; Go build clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 0bcd729 commit 24abae2
3 files changed
Lines changed: 25 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
| |||
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | | - | |
456 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
| |||
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
977 | 982 | | |
978 | | - | |
| 983 | + | |
979 | 984 | | |
980 | 985 | | |
981 | 986 | | |
| |||
0 commit comments