feat(admin): rewire launch-app to check-for-updates UI nav + frontend polling

This commit is contained in:
Leo
2026-06-02 18:20:04 -04:00
parent 7a2d283379
commit fb98de229d
4 changed files with 62 additions and 6 deletions
+7 -4
View File
@@ -2841,11 +2841,14 @@ async def admin_msfs_sync_task(task_id: str):
@app.post("/api/admin/msfs-sync/launch-app")
async def admin_msfs_sync_launch():
"""Launch the MS Field Service app on the connected phone."""
"""Launch MS Field Service app, navigate to Check for Updates via UI nav.
Taps globe icon in top-right, waits 15s, taps Check for Updates button,
then waits for the phone's offline DB to stabilize.
"""
try:
async with httpx.AsyncClient(timeout=15) as client:
resp = await client.post(f"{EXTRACTION_SYNC_BASE}/api/sync/start")
# The start endpoint already launches the app
async with httpx.AsyncClient(timeout=30) as client:
resp = await client.post(f"{EXTRACTION_SYNC_BASE}/api/sync/check-for-updates")
return resp.json()
except httpx.RequestError as e:
raise HTTPException(502, f"Extraction server unreachable: {e}")