thomashoneyman / purescript-halogen-realworld

Exemplary real world application built with PureScript + Halogen
https://thomashoneyman.com/guides/real-world-halogen
MIT License
788 stars 85 forks source link

Global Feed shows "Articles not yet loaded" #127

Closed pete-murphy closed 6 months ago

pete-murphy commented 6 months ago

As an unauthenticated user, with the Global Feed tab selected, I see no articles (and a "Articles not yet loaded" message)

Screenshot showing Global Feed tab selected, and Articles not yet loaded message

In the browser console I see an error reported about a failure to decode ArticleWithMetadata because of a bad Slug

[ERROR: 2024-22-03 02:57:05 AM]
An error occurred while decoding a JSON value:
  Under 'PaginatedArray ArticleWithMetadata':
  At object key body:
  At array index 0:
  Under 'ArticleWithMetadata':
  At object key slug:
  Under 'Slug':
  Unexpected value "Ill-quantify-the-redundant-TCP-bus-that-should-hard-drive-the-ADP-bandwidth!-553".

The Slug package expects that a slug "consists of alphanumeric groups of characters" and that "every character with a defined notion of case is lower-cased," but slugs from api.realworld.io/api/articles can contain upper-case letters and ! apparently.

❯ curl -s "https://api.realworld.io/api/articles" | jq ".articles[].slug"
"Ill-quantify-the-redundant-TCP-bus-that-should-hard-drive-the-ADP-bandwidth!-553"
"quantifying-the-circuit-wont-do-anything-we-need-to-parse-the-back-end-FTP-interface!-553"
"Ill-compress-the-optical-SDD-hard-drive-that-should-interface-the-XSS-bandwidth!-553"
"The-JSON-interface-is-down-hack-the-haptic-transmitter-so-we-can-bypass-the-XML-system!-553"
"We-need-to-quantify-the-primary-TCP-matrix!-553"
"If-we-hack-the-firewall-we-can-get-to-the-USB-application-through-the-bluetooth-SDD-system!-553"
"Ill-override-the-digital-ADP-alarm-that-should-microchip-the-USB-firewall!-553"
"Try-to-calculate-the-JBOD-firewall-maybe-it-will-override-the-redundant-port!-553"
"Try-to-transmit-the-HTTP-card-maybe-it-will-override-the-multi-byte-hard-drive!-553"
"Use-the-open-source-THX-application-then-you-can-quantify-the-solid-state-transmitter!-553"
thomashoneyman commented 6 months ago

😞 ideally we’d not have some of these characters in the article slugs at all, but so be it! Agree we need to fix this.