[WS-2839]: Hide articles in myNews page when metadata is not present#14170
Open
LukasFrm wants to merge 12 commits into
Open
[WS-2839]: Hide articles in myNews page when metadata is not present#14170LukasFrm wants to merge 12 commits into
LukasFrm wants to merge 12 commits into
Conversation
…metadata-is-not-present
jinidev
reviewed
Jul 3, 2026
jinidev
reviewed
Jul 3, 2026
…ot-present' of https://github.com/bbc/simorgh into WS-2839-hide-articles-in-mynews-page-when-metadata-is-not-present
jinidev
approved these changes
Jul 7, 2026
elvinasv
approved these changes
Jul 7, 2026
elvinasv
left a comment
Member
There was a problem hiding this comment.
Tested using http://localhost.bbc.com:7081/hindi/articles/cwy0pz7qydzo?renderer_env=live(which has an invalid metadata). Works as expected 👍
SantaZena
approved these changes
Jul 8, 2026
…metadata-is-not-present
…metadata-is-not-present
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.
Resolves JIRA: https://bbc.atlassian.net/browse/WS-2839
Summary
Articles with
metaData: nullare now filtered out before rendering on the My News page.Sanitises
promoImageAltTextbefore it is posted to the UAS favourites API. Article alt text containing newline characters (e.g."शाहरुख़ ख़ान\n") was causing the stored metadata to be silently dropped when fetching saved articles back from UAS.Code changes
metaDatamade optional onUasActivityItem; items without it are filtered ingetRecentActivitysanitiseMetadataStringhelper inuasUtility.tsthat strips\r/\ncharacters and trims whitespace from a string before it is sent to UAS (otherwise if present inmetaData, the object itself is stripped).sanitiseMetadataStringtopromoImageAltTextso all save/update payloads are clean.uasUtility.test.tswith unit tests covering trailing newlines,\r\n, embedded newlines, empty/undefined input, and clean strings.Testing
metaDatashould includepromoImageAltText: "शाहरुख़ ख़ान\n").metaData.promoImageAltTexthas no\nin it (check Network tab or logs).yarn test src/app/lib/uasApi/uasUtility.test.ts— all tests should pass.Useful Links