Decouple IEM map images from Map.Enabled/Mapbox#29
Merged
Conversation
MapService.GetMapUrlAsync gated its whole body -- including the two no-account IEM autoplot paths (#208 for VTEC alerts, #217 for SPS) -- behind Map.Enabled, a setting documented and named for Mapbox. A fresh install with no Mapbox account (the shipped default) got zero map images for ordinary NWS alerts, even though IEM needs no signup. Confirmed live: a Discord post for an Extreme Heat Warning had no image. IEM is now always attempted first regardless of Map.Enabled; that setting (and AccessToken) only gate the Mapbox fallback, routed through the existing GetMapboxFallbackUrlAsync so both call sites share one "is Mapbox usable" check. SPC Outlook/MCD/ERO were already unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfWmHii9XYmPNBhz5dGDxZ
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.
Summary
MapService.GetMapUrlAsyncno longer gates the IEM autoplot paths (#208 for VTEC alerts, #217 for SPS) behindMap.Enabled— those need no account/token and are now always attempted first.Map.Enabled/AccessTokennow only gate the Mapbox fallback, via the existingGetMapboxFallbackUrlAsync(shared with the download-retry fallback path inSocialMediaOrchestrator).Map.Enabled.Why
A fresh install with
Map.Enabled: false(the shipped default, since Mapbox setup is optional) got zero map images for ordinary NWS warnings/watches/advisories — confirmed live via a Discord post for an Extreme Heat Warning with no image attached — even though IEM's autoplot images need no Mapbox account at all. SPC Outlook/MCD/ERO were already unaffected since they build their own images independently ofMapService.Test plan
dotnet build— 0 errors/warningsdotnet test NwsAlertBot.Tests/NwsAlertBot.Tests.csproj— 97/97 passedMap.Enabled: falseand no Mapbox token, confirming an IEM image now attaches (not automatable — no HTTP mocking in this test project; existing tests are pure-logic-only per project convention)https://claude.ai/code/session_01CfWmHii9XYmPNBhz5dGDxZ