Skip to content

Fix News & Announcements parity between web and Android#605

Merged
kckagancan merged 4 commits into
developmentfrom
fix/news-announcements-backend-parity
May 12, 2026
Merged

Fix News & Announcements parity between web and Android#605
kckagancan merged 4 commits into
developmentfrom
fix/news-announcements-backend-parity

Conversation

@erinc00

@erinc00 erinc00 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes cross-platform parity issues in News & Announcements by making both web and Android backend-driven and removing demo/hardcoded announcement content from runtime paths.

What Changed

Android

  • Replaced hardcoded news list with backend-driven announcements.
  • Added announcements data layer:
    • GET /announcements?limit=100
    • GET /announcements/:announcementId
  • Updated News screen with:
    • loading, error, empty, and retry states
    • summary + "Open announcement" behavior
  • Replaced popup detail with a dedicated announcement detail screen via navigation route.

Web

  • Unified CTA text to "Open announcement".
  • Removed demo/fallback announcement seed usage from:
    • news list
    • news detail
    • home preview
  • If API fails and cache exists, show cached announcements with warning.
  • If API fails and cache does not exist, show explicit error state (no silent demo content).

Formatting

  • Forced English locale (en-US) for timestamp formatting to keep News dates consistent in English.

Acceptance Criteria Mapping

  • Web and Android now consume the same backend announcements endpoints.
  • Admin-created/updated/deleted announcements can be reflected on both platforms after refresh.
  • Android no longer uses hardcoded mock announcements as primary source.
  • Web no longer silently shows demo content as if live.
  • Loading/error/empty/retry states are present on Android.

Validation

  • Android: ./gradlew :app:compileDebugKotlin
  • Web: npx tsc --noEmit

Issue

Closes #598

@erinc00 erinc00 requested a review from kckagancan May 12, 2026 11:20

@kckagancan kckagancan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The product direction of this PR looks correct: Android is now backend-driven for News & Announcements, the old hardcoded mockNews list is removed, web no longer silently falls back to demo announcements, and cached announcements are labeled as cached instead of live. This matches the intent of #598.

However, the PR is not merge-ready yet because the E2E suite is currently failing.

The failing test is web/e2e/news-fallback.spec.js. It still asserts the old behavior:

  • Using fallback news
  • demo announcement content such as Know your nearest gathering area
  • fallback/demo content shown when the announcements API is unavailable

But this PR intentionally changes that behavior. When the API fails and there is no cache, the expected behavior should now be an explicit error/empty state, not demo announcements shown as fallback content.

Please update the E2E test to match the new product behavior instead of restoring the old fallback behavior.

Suggested update:

  • Rename the test from “shows demo announcements...” to something like:
    shows explicit error state when news API is unavailable and no cache exists
  • Keep the /api/announcements 503 route mock.
  • Assert:
    • Couldn't load announcements is visible
    • the error copy indicates announcements could not be loaded/refreshed
    • Retry news is visible
    • No announcements could be loaded right now. is visible
    • old demo announcement titles are NOT visible
  • Optionally add a separate test for the cached fallback path:
    • seed localStorage with cached announcements
    • make /api/announcements fail
    • assert Using cached announcements
    • assert cached content is shown with a warning

Do not reintroduce demo fallback announcements. The new behavior is correct for #598; the regression is only that the E2E test still expects the old behavior.

Minor non-blocking notes:

  • Android AnnouncementsRepository.fetchAnnouncements() clamps limit to 200, while the backend validator allows max 100. The current default is 100, so this is not currently breaking, but aligning the clamp to 100 would be cleaner.
  • AnnouncementSummary.hasMore is currently unused in Android NewsScreen.kt; harmless, but it can be removed for cleanliness.

After updating the E2E expectations and getting CI green, I think this PR should be merge-ready.

- update news-fallback spec for no-cache error state
- add cached-announcements fallback path e2e coverage
- clamp android announcements limit to backend max (100)
- remove unused hasMore from Android news summary helper
@kckagancan kckagancan self-requested a review May 12, 2026 11:35
@erinc00 erinc00 requested a review from kckagancan May 12, 2026 11:35

@kckagancan kckagancan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes. Looks good now. Merging.

@kckagancan kckagancan merged commit d806e3c into development May 12, 2026
4 checks passed
@kckagancan kckagancan deleted the fix/news-announcements-backend-parity branch May 12, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants