Fix MAS temperature: grant network entitlement, fetch off-thread#4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
App Review rejected build 0.4.3 under Guideline 2.1(a) - Performance - App Completeness:
Root cause: the Mac App Store build runs in the App Sandbox, and
packaging/macos/entitlements.mas.plistwas missingcom.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
com.apple.security.network.clientto the MAS entitlements. This is the actual fix for the rejection.WeatherStatenow 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 callsset_titlewhen the text actually changed, so a landed temperature appears within one 200ms tick and never stalls the loop.Testing
Builds clean under
default,mas, andmas weatherfeature sets. No new clippy warnings.After merge: tag
v0.4.4to trigger the release + MAS upload job, then attach the new build in App Store Connect and resubmit for review.