When the MeshCore ingestor starts, _try_send_snapshot() in daemon.py is called
immediately after connected_event.set() in runner.py. However, ensure_contacts()
is called afterconnected_event.set(), meaning the snapshot fires before the
contacts dict is populated. As a result, known contacts (including repeaters and
companion nodes) are not upserted to PotatoMesh on startup.
Steps to Reproduce
Run the MeshCore ingestor with PROTOCOL=meshcore against a companion device
that has existing contacts
Observe that known contacts do not appear in the PotatoMesh dashboard on startup
Stop and re-run the ingestor manually — contacts appear correctly
Root Cause
In runner.py:
connected_event.set() is called at line ~114
ensure_contacts() is called at line ~119 after the event is set
In daemon.py:
_try_send_snapshot() fires as soon as connected_event is set
At this point iface._contacts is still empty
initial_snapshot_sent is set to True and never retried
Expected Behaviour
ensure_contacts() should complete before connected_event is set, or the snapshot
should be deferred until contacts have been fetched.
Environment
PotatoMesh version: v0.6.3+2-705f15c
MeshCore library version: 2.3.7
Connection type: Serial (/dev/ttyACM0)
OS: Debian/Ubuntu
When the MeshCore ingestor starts, `_try_send_snapshot()` in `daemon.py` is called
immediately after `connected_event.set()` in `runner.py`. However, `ensure_contacts()`
is called *after* `connected_event.set()`, meaning the snapshot fires before the
contacts dict is populated. As a result, known contacts (including repeaters and
companion nodes) are not upserted to PotatoMesh on startup.
## Steps to Reproduce
1. Run the MeshCore ingestor with `PROTOCOL=meshcore` against a companion device
that has existing contacts
2. Observe that known contacts do not appear in the PotatoMesh dashboard on startup
3. Stop and re-run the ingestor manually — contacts appear correctly
## Root Cause
In `runner.py`:
- `connected_event.set()` is called at line ~114
- `ensure_contacts()` is called at line ~119 *after* the event is set
In `daemon.py`:
- `_try_send_snapshot()` fires as soon as `connected_event` is set
- At this point `iface._contacts` is still empty
- `initial_snapshot_sent` is set to `True` and never retried
## Expected Behaviour
`ensure_contacts()` should complete before `connected_event` is set, or the snapshot
should be deferred until contacts have been fetched.
## Environment
- PotatoMesh version: v0.6.3+2-705f15c
- MeshCore library version: 2.3.7
- Connection type: Serial (`/dev/ttyACM0`)
- OS: Debian/Ubuntu
<!-- github-sync-id:4429614492 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When the MeshCore ingestor starts,
_try_send_snapshot()indaemon.pyis calledimmediately after
connected_event.set()inrunner.py. However,ensure_contacts()is called after
connected_event.set(), meaning the snapshot fires before thecontacts dict is populated. As a result, known contacts (including repeaters and
companion nodes) are not upserted to PotatoMesh on startup.
Steps to Reproduce
PROTOCOL=meshcoreagainst a companion devicethat has existing contacts
Root Cause
In
runner.py:connected_event.set()is called at line ~114ensure_contacts()is called at line ~119 after the event is setIn
daemon.py:_try_send_snapshot()fires as soon asconnected_eventis setiface._contactsis still emptyinitial_snapshot_sentis set toTrueand never retriedExpected Behaviour
ensure_contacts()should complete beforeconnected_eventis set, or the snapshotshould be deferred until contacts have been fetched.
Environment
/dev/ttyACM0)