Misc. doc, test, and qol improvements

This commit is contained in:
Jack Kingsman
2026-02-27 15:17:29 -08:00
parent c40603a36f
commit 6a3510ce2e
12 changed files with 277 additions and 22 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ Keep it aligned with `app/` source files and router behavior.
- FastAPI
- aiosqlite
- Pydantic
- MeshCore Python library (`references/meshcore_py`)
- MeshCore Python library (`meshcore` from PyPI)
- PyCryptodome
## Backend Map
+4 -9
View File
@@ -443,6 +443,8 @@ async def _periodic_advert_loop():
"""
while True:
try:
await asyncio.sleep(ADVERT_CHECK_INTERVAL)
# Try to send - send_advertisement() handles all checks
# (disabled, throttled, not connected)
if radio_manager.is_connected:
@@ -455,9 +457,6 @@ async def _periodic_advert_loop():
except RadioOperationBusyError:
logger.debug("Skipping periodic advertisement: radio busy")
# Sleep before next check
await asyncio.sleep(ADVERT_CHECK_INTERVAL)
except asyncio.CancelledError:
logger.info("Periodic advertisement task cancelled")
break
@@ -595,9 +594,7 @@ async def _sync_contacts_to_radio_inner(mc: MeshCore) -> dict:
break
if len(selected_contacts) < max_contacts:
recent_contacts = await ContactRepository.get_recent_non_repeaters(
limit=max_contacts
)
recent_contacts = await ContactRepository.get_recent_non_repeaters(limit=max_contacts)
for contact in recent_contacts:
key = contact.public_key.lower()
if key in selected_keys:
@@ -658,9 +655,7 @@ async def _sync_contacts_to_radio_inner(mc: MeshCore) -> dict:
}
async def sync_recent_contacts_to_radio(
force: bool = False, mc: MeshCore | None = None
) -> dict:
async def sync_recent_contacts_to_radio(force: bool = False, mc: MeshCore | None = None) -> dict:
"""
Load contacts to the radio for DM ACK support.
+3 -1
View File
@@ -539,7 +539,9 @@ async def create_contact(
"last_contacted": existing.last_contacted,
}
)
existing.name = request.name
refreshed = await ContactRepository.get_by_key(request.public_key)
if refreshed is not None:
existing = refreshed
# Trigger historical decryption if requested (even for existing contacts)
if request.try_historical: