Skip to content

Fix MAS temperature: grant network entitlement, fetch off-thread#4

Merged
peterdsp merged 1 commit into
mainfrom
fix/mas-temperature-network
Jul 8, 2026
Merged

Fix MAS temperature: grant network entitlement, fetch off-thread#4
peterdsp merged 1 commit into
mainfrom
fix/mas-temperature-network

Conversation

@peterdsp

@peterdsp peterdsp commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Why

App Review rejected build 0.4.3 under Guideline 2.1(a) - Performance - App Completeness:

Bug description: MenuBar > Temperature option does not display temperature.

Root cause: the Mac App Store build runs in the App Sandbox, and packaging/macos/entitlements.mas.plist was missing com.apple.security.network.client. Without it the sandbox blocks every outbound connection, so the opt-in Temperature mode (ip-api.com geolocation + open-meteo.com) never reached the network and silently showed nothing. It works on dev/unsigned builds only because those aren't sandboxed.

How

  • Grant the network entitlement - add com.apple.security.network.client to the MAS entitlements. This is the actual fix for the rejection.
  • Move the weather fetch off the main thread - WeatherState now reads a shared, mutex-guarded cache and spawns a detached worker to refresh when the value is stale. Includes a 60s retry floor (so a failing network isn't hammered once per tick) and a stale-value fallback (shows the last known temperature while refreshing). The event loop refreshes the title every tick but only calls set_title when the text actually changed, so a landed temperature appears within one 200ms tick and never stalls the loop.
  • Bump to 0.4.4 so the resubmitted App Store binary gets a fresh build number.

Testing

Builds clean under default, mas, and mas weather feature sets. No new clippy warnings.

After merge: tag v0.4.4 to trigger the release + MAS upload job, then attach the new build in App Store Connect and resubmit for review.

App Review rejected build 0.4.3 under 2.1(a) - the menu bar
"Temperature" mode showed nothing. Root cause: the MAS entitlements
lacked com.apple.security.network.client, so the sandbox blocked the
ip-api.com + open-meteo.com requests. Works on dev builds only because
those are not sandboxed.

- Add com.apple.security.network.client to entitlements.mas.plist.
- Move the weather fetch off the main event-loop thread: WeatherState
  now reads a shared cache and spawns a worker to refresh when stale,
  with a 60s retry floor and a stale-value fallback. The tick refreshes
  the title only when the text changed, so a landed temperature shows
  within one tick and never stalls the loop.
- Bump version to 0.4.4 for a fresh App Store build number.
Copilot AI review requested due to automatic review settings July 8, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@peterdsp
peterdsp merged commit 1b85490 into main Jul 8, 2026
@peterdsp
peterdsp deleted the fix/mas-temperature-network branch July 8, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants