[ferry]: Update ferry fare cards#3294
Conversation
…remove the ferry_inner_harbor fares once the content is updated.
…s computed in a function with route specific overrides?
joshlarson
left a comment
There was a problem hiding this comment.
I'm doing a bit more digging to see if I can help find more actionable feedback here, but this change is causing the ferry fares page to crash with 👇 stack trace:
2026-06-29 15:48:59.087 [error] mbta_id=43634282 request_id=GL2lFWcAPrnnmQcAAOli ** (BadMapError) expected a map, got:
nil
(dotcom 0.0.1) lib/dotcom_web/templates/cms/paragraph/_fare_card.html.heex:6: anonymous fn/2 in DotcomWeb.CMS.ParagraphView."_fare_card.html"/1
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:134: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.recur_iodata/1
(dotcom 0.0.1) lib/dotcom_web/templates/cms/paragraph/_column_multi.html.heex:17: anonymous fn/2 in DotcomWeb.CMS.ParagraphView."_column_multi.html"/1
(elixir 1.19.5) lib/enum.ex:1688: Enum."-map/2-lists^map/1-1-"/2
(dotcom 0.0.1) lib/dotcom_web/templates/cms/paragraph/_column_multi.html.heex:16: anonymous fn/2 in DotcomWeb.CMS.ParagraphView."_column_multi.html"/1
(elixir 1.19.5) lib/enum.ex:1688: Enum."-map/2-lists^map/1-1-"/2
(elixir 1.19.5) lib/enum.ex:1688: Enum."-map/2-lists^map/1-1-"/2
(dotcom 0.0.1) lib/dotcom_web/templates/cms/paragraph/_column_multi.html.heex:14: anonymous fn/3 in DotcomWeb.CMS.ParagraphView."_column_multi.html"/1
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:134: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.recur_iodata/1
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:146: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.recur_iodata/3
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:86: Phoenix.HTML.Safe.Phoenix.LiveView.Comprehension.to_iodata/2
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:82: anonymous fn/3 in Phoenix.HTML.Safe.Phoenix.LiveView.Comprehension.to_iodata/1
(elixir 1.19.5) lib/enum.ex:2520: Enum."-reduce/3-lists^foldl/2-0-"/3
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:82: Phoenix.HTML.Safe.Phoenix.LiveView.Comprehension.to_iodata/1
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:146: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.recur_iodata/3
(phoenix_html 4.3.0) lib/phoenix_html.ex:140: Phoenix.HTML.html_escape/1
(phoenix_html_helpers 1.0.1) lib/phoenix_html_helpers/tag.ex:105: PhoenixHTMLHelpers.Tag.content_tag/3
(dotcom 0.0.1) lib/dotcom_web/templates/layout/root.html.heex:137: anonymous fn/2 in DotcomWeb.LayoutView."root.html"/1
(phoenix_live_view 1.1.26) lib/phoenix_live_view/engine.ex:134: Phoenix.HTML.Safe.Phoenix.LiveView.Rendered.recur_iodata/1
(phoenix 1.8.6) lib/phoenix/controller.ex:1015: anonymous fn/5 in Phoenix.Controller.template_render_to_iodata/4The crash is cache-dependent, so in order to reliably reproduce it, you need to run 👇 in an iEX shell while on your branch.
iex> Dotcom.Cache.Multilevel.flush| duration: :single_trip, | ||
| media: [:mticket, :paper_ferry, :contactless_payment, :cash], | ||
| reduced: nil, | ||
| reduced: :any, |
There was a problem hiding this comment.
Issue (blocking): I'm not entirely sure what this field is for, but the page crashes unless this is set to nil or omitted 😵💫
There was a problem hiding this comment.
I just found the same thing... nil it is!
There was a problem hiding this comment.
To embellish a bit, I don't know what the field is for, but I do have a sense of why this change is causing the page to crash:
LiquidObjects.Fare.get_fares/1makes a call toFares.Repowith a set of default (overridable) arguments- Those default arguments include
reduced: nil, which means that this entry, withreduced: :any, won't match. - That causes
fareto benilin the fare card template, which then causes the stack trace above when we try to queryfare.modea few lines down.
Changing reduced back to nil does fix the crash... I have no idea if there's a more elegant or correct way though.
There was a problem hiding this comment.
Heh - I wrote ☝️ whole thing before I saw that you replied 😅
Scope
Asana Ticket: ⛴️ 💸 Update ferry fare cards
Implementation
Updated the reduced price fareScreenshots
No visual changes?
How to test
http://localhost:4001/fares/ferry-fares
Not sure how to test, Confirm it doesn't crash?