feat: auto-unblock internet during update check#308
Conversation
When the user initiates an update while internet is blocked, the UpdateCard now prompts to temporarily allow internet access. On confirmation it unblocks WAN via system.setInternetAccess, proceeds with the update, and automatically re-blocks internet after the service reconnects (or on failure). If internet is already allowed, the flow is unchanged. Closes #306
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthrough
Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant UI as UpdateCard UI
participant Server as TRPC Server
participant System as System
User->>UI: Click "Check for Updates"
UI->>Server: system.internetStatus (query)
Server->>System: Check iptables/inet status
System-->>Server: { blocked: true }
Server-->>UI: Internet is blocked
UI->>UI: Transition to internet-prompt state
UI->>User: Show "Allow Internet?" prompt
User->>UI: Click "Allow & Update"
UI->>UI: Transition to unblocking state
UI->>Server: system.setInternetAccess({ blocked: false })
Server->>System: Unblock internet
System-->>Server: Unblock complete
Server-->>UI: Success
UI->>UI: Set didUnblockRef = true
UI->>UI: Trigger update check (normal flow)
rect rgba(100, 150, 200, 0.5)
UI->>Server: Check for updates (internet now available)
Server->>System: Download/check via internet
System-->>Server: Update available/complete
Server-->>UI: Response
end
UI->>Server: system.setInternetAccess({ blocked: true })
Server->>System: Re-block internet
System-->>Server: Re-block complete
Server-->>UI: Success
UI->>UI: Transition to idle/success state
UI->>User: Show result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ng
left a comment
There was a problem hiding this comment.
Adversarial Code Review — Standard Depth
Fixed (1)
- Unmount during polling leaves WAN open — Added
reblockIfNeededto useEffect cleanup. If user navigates away after "Allow & Update", internet is now re-blocked on unmount.
Rejected (3 — false positives)
- Cancel leak — Cancel button is removed from DOM before unblock resolves; path unreachable
- startUpdate throws past catch — startUpdate never propagates; its own catch always fires
- Stale cache (10s) — staleTime defaults to 0 in this project; fresh fetch always issued
Noted (3 — architectural, not this PR)
blockWan()in system.ts omits mDNS rules vs install script (pre-existing Major)- sp-update double iptables management — design choice, UI manages WAN lifecycle
- Silent re-block failure — best-effort is acceptable for this flow
Recommendation: Approve
## Summary Promotes everything on \`dev\` since the last main release (82 commits, 143 files, +9239/-2699). ### Headlining features - **Schedule redesign (#303)** — read-only schedule view with explicit curve management, full-screen \`CurveEditor\` (day picker + bedtime/wake + temp range + presets), \`Left | Right | Both\` side selector, active-curve highlight, atomic \`batchUpdate\` writes, day-conflict resolution, sparkline cards. - **Mini feature flag (#420)** — \`ENABLE_MINI\` env var; PubNub moved to \`optionalDependencies\`; conditional Mini router import. - **Auto-off on no presence (#301)** — schedule respects bed presence. - **Auto-unblock internet during update check (#308)**. - **Schedule batchUpdate cap raised to 1000 (#424)** — fixes AI-curve apply-to-all-days rejection. ### Operational fixes - Pod 3 install path (#383, #384, #386, #392) - Yocto image Python venv (#336) - DAC socket / Avahi on device startup (#331) - Free-sleep/sleepypod switch persistence (#337) - Cross-machine standalone deploys (#308) - Temperature unit conversion (#333) ### Dependency updates ~20 renovate PRs across React 19.2.5, Next 16.2.3, vitest 4.1.4, tanstack/react-query 5.97.0, tRPC 11.16, lucide-react 1.x, etc. ### Misc - ADR 0017 (uv) compiled into deployment wiki - Snoo pentest methodology + recon plan - Git hooks + ESLint cleanup (#313) - CI hardening (#388) ## Test plan - [x] All unit tests pass on dev (606+ tests) - [x] Typecheck clean - [x] Build succeeds (standalone output) - [x] Deployed to Pod 4 at \`192.168.1.88\` and smoke-tested: - schedule on/off - create curve from preset - edit curve, change days, save - day-conflict reassign dialog - delete curve - side selector left/right/both - active-curve highlighting + next set point
|
🎉 This PR is included in version 1.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
system.internetStatusandsystem.setInternetAccessAPIsCloses #306
Test plan
Summary by CodeRabbit
New Features