MapRepo.get/2 flattened every error from Api.Map.by_id/1 into
{:error, :not_found}. That turned infrastructure faults into a
"map does not exist" signal: a DBConnection.OwnershipError in test
surfaced as "Failed to load map state" -> "map not loaded" ->
"Timeout waiting for map ... Check Map.Manager is running", pointing
at Map.Manager (which was running fine) instead of the real cause.
Keep the :not_found translation for a genuine Ash NotFound, and
propagate + log anything else.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
LiveView event handlers were trusting client-supplied record IDs without
verifying they belong to the user's current map/user scope. A logged-in
user could push another map's record UUID over the LV socket and act on
it. Affected handlers:
- cancel-subscription / edit-subscription / update_subscription
(cancel or upgrade any map's paid subscription by ID)
- characters_live.ex "delete"
(soft-delete any user's character and null their user_id)
- cancel_ping
(cross-map rally-ping cancellation broadcast)
- deleteSystemComment
(cross-map comment deletion)
- update_passage_mass
(cross-map wormhole passage mass corruption)
- updateCharacterTracking
(untrack another user's character on a shared map)
Also fixes a related numeric-trust bug in subscribe/update_subscription
where `period`, `characters_limit`, and `hubs_limit` were parsed without
bounds, allowing `period: "-1"` to produce a back-dated subscription
with a negative price.
Adds WandererAppWeb.HandlerAuth with focused helpers each handler now
routes through, plus 26 regression tests covering both the IDOR auth
checks and the bounded-int parsers.
- fix(config): Set default database hostname to `localhost` in `dev.exs` and `test.exs`
- fix(config): Add `DB_HOST` environment variable override for dev and test environments to `runtime.exs`
- fix(mapper): Update `whClassName` values for C1 and C4 destination types
- refactor(mapper): Consolidate K162 and multi-destination checks in bookmark formatting helper
- fix(map): Remove `c4_to_ns?` check and small ship size constraint from connection operations
- fix(bookmarks): Remove the early return condition that compared the input value to the previous local state
- fix(bookmarks): Replace `newVal` comparison with a direct check between the input value and `savedVal` to trigger `updateSetting`
- fix(settings): Check if input value differs from `savedMapping` before calling `updateSetting`
- feat(settings): Add `size_k162_unknown` to bookmark size options
- fix(bookmarks): Exclude `MULTI_DEST_WHS` from size data assignments in `formatBookmarkName`
- feat(bookmarks): Apply `size_k162_unknown` custom mapping for `K162` signature sizes