Dawnline 0.8.1
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions

- Fixed: the Overview's map stayed empty after leaving the page and coming
  back (the map freed on leaving was never made again); a map still loading
  when freed no longer draws into a dropped element
- A new connection's city shows within seconds: the agent looks its address
  up the moment the device connects or roams, in a child process so the
  watcher never waits, and open pages refresh once the place is known; the
  connection's entry in the activity log gets its place too. Since 0.7.0 the
  lookup waited for the minute tick and the pages for their 30-second poll
- Device window: each place has a strip of when the device was there (from
  the log's connections) and its share of the time; ▶ replays the period on
  the map: the place it leaves goes gray, a blue shimmer runs along a dotted
  arc to the next one, which lights up. A click or a drag on a strip goes to
  that moment; short visits are folded only past 24 moves. The fixed trail
  line is gone, and place names are no longer cut off at the map's edges
- Overview: the disguise tile's icon is gray when the disguise is Off
- People: "Add device" is a dashed chip with its label; "Send invite" is gone
  from the card (the invite card stays in its ⋯ menu)
This commit is contained in:
Aemeath committed 2026-10-19 00:48:09 +03:00
1 parent 466ca6c7b0
commit 7a6370aa9e
21 files changed
+1241 -193

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
// dawnline.geo: which addresses need a lookup, how results go into the cache
// (bounded, never pushing out what is still shown) and the activity-log label.
import * as geo from 'dawnline.geo';
const NOW = 1790000000;
const PLACE = { lat: 45.04, lon: 38.98, city: 'Krasnodar', country: 'Russia', cc: 'RU', asn: 12389, org: 'Rostelecom' };
test('stale', () => {
let cache = { ips: {
'37.78.36.76': { ...PLACE, ts: NOW - 86400 },
'212.233.85.1': { ...PLACE, ts: NOW - 31 * 86400 },
'185.135.150.35': { fail: NOW - 3600 },
'185.135.150.28': { fail: NOW - 2 * 86400 },
'83.239.111.148': { lat: 1, lon: 2, city: 'Old', ts: NOW },
}, home: null };
eq(geo.stale(cache, [ '37.78.36.76' ], NOW), [], 'fresh: known');
eq(geo.stale(cache, [ '212.233.85.1' ], NOW), [ '212.233.85.1' ], 'older than the TTL');
eq(geo.stale(cache, [ '185.135.150.35' ], NOW), [], 'failed today: not again yet');
eq(geo.stale(cache, [ '185.135.150.28' ], NOW), [ '185.135.150.28' ], 'failed two days ago: retried');
eq(geo.stale(cache, [ '83.239.111.148' ], NOW), [ '83.239.111.148' ], 'an entry from before ASNs were kept');
eq(geo.stale(cache, [ '10.0.1.164', '100.64.1.1', '', null, 'fe80::1' ], NOW), [], 'local addresses never');
eq(geo.stale(cache, [ '1.1.1.1', '8.8.8.8', '1.1.1.1' ], NOW), [ '1.1.1.1', '8.8.8.8' ], 'once each, in order');
});
test('merge', () => {
let cache = { ips: {}, home: null };
ok(geo.merge(cache, { '1.1.1.1': { ...PLACE }, '8.8.8.8': false }, [], NOW), 'changed');
eq(cache.ips['1.1.1.1'], { ...PLACE, ts: NOW }, 'a place, stamped');
eq(cache.ips['8.8.8.8'], { fail: NOW }, 'nothing found: a failure, retried later');
ok(!geo.merge(cache, {}, [], NOW), 'no results: unchanged');
ok(!geo.merge(cache, { '10.0.0.1': PLACE }, [], NOW) && !cache.ips['10.0.0.1'], 'a local address is not kept');
eq(geo.place(cache, '1.1.1.1')?.city, 'Krasnodar', 'place');
eq(geo.place(cache, '8.8.8.8'), null, 'no place for a failure');
});
test('merge keeps the cache bounded, what is shown stays', () => {
let cache = { ips: {}, home: null };
for (let i = 0; i < 500; i++)
cache.ips[`1.0.${int(i / 250)}.${i % 250 + 1}`] = { ...PLACE, ts: NOW - 1000 + i };
let oldest = '1.0.0.1', second = '1.0.0.2';
ok(geo.merge(cache, { '9.9.9.9': PLACE }, [ oldest ], NOW), 'changed');
eq(length(keys(cache.ips)), 500, 'back to the cap');
ok(cache.ips[oldest] != null, 'the oldest is still shown: kept');
ok(cache.ips[second] == null, 'the oldest not shown went');
ok(cache.ips['9.9.9.9'] != null, 'the new one is in');
});
test('label', () => {
eq(geo.label(PLACE), 'Krasnodar · Rostelecom', 'city and ISP');
eq(geo.label({ city: '', org: 'Rostelecom' }), 'Rostelecom', 'no city');
eq(geo.label(null), null, 'no place');
});
+18
View File
@@ -48,3 +48,21 @@ test('endpoint_ip', () => {
eq(live.endpoint_ip('[2001:db8::1]:41821'), '2001:db8::1', 'v6');
eq(live.endpoint_ip(''), '', 'none');
});
// A connect is logged before its new address is located; the place comes later.
test('fill_places', () => {
let ev = [
{ type: 'connect', detail: '1.1.1.1', where: null, ts: 100 },
{ type: 'connect', detail: '1.1.1.1', where: null, ts: 200 },
{ type: 'disconnect', detail: null, ts: 210 },
{ type: 'connect', detail: '8.8.8.8', where: 'Mountain View · Google', ts: 220 },
{ type: 'connect', detail: '9.9.9.9', where: null, ts: 230 },
];
ok(live.fill_places(ev, { '1.1.1.1': 'Sydney · Cloudflare', '8.8.8.8': 'Elsewhere' }, 150), 'changed');
eq(ev[1].where, 'Sydney · Cloudflare', 'the waiting connect gets its place');
eq(ev[0].where, null, 'older than `since`: left alone');
eq(ev[3].where, 'Mountain View · Google', 'a place already there stays');
eq(ev[4].where, null, 'another address');
ok(!live.fill_places(ev, { '7.7.7.7': 'X' }, 0), 'nothing to fill: unchanged');
ok(!live.fill_places([], { '1.1.1.1': 'X' }, 0), 'empty log');
});