Skip to content

fix(frontend): notify subscribers after persisted cache hydration - #413

Open
Alae-Tamouh wants to merge 1 commit into
aws-samples:mainfrom
Alae-Tamouh:contrib/persisted-cache-hydration
Open

fix(frontend): notify subscribers after persisted cache hydration#413
Alae-Tamouh wants to merge 1 commit into
aws-samples:mainfrom
Alae-Tamouh:contrib/persisted-cache-hydration

Conversation

@Alae-Tamouh

Copy link
Copy Markdown
Contributor

Issue #, if available: None

Description of changes:

Problem

Projects and sprints are hydrated from sessionStorage inside mount effects. Subscribers render before hydration and initially observe an empty external store. When the persisted entry is fresh, network revalidation returns early, so no version change occurs and mounted views can remain empty indefinitely.
image

Solution

Notify the existing project and per-project sprint external-store subscribers immediately after adopting persisted cache entries.

Impact

Dashboard, space, and sprint views rerender with fresh persisted data without requiring an unnecessary network request. Cache TTL and refresh behavior are unchanged.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment thread frontend/src/hooks/useProjectsCache.test.ts

@jeromevdl jeromevdl 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 @Alae-Tamouh for this fix. One minor test improvement before approving.

@Alae-Tamouh
Alae-Tamouh force-pushed the contrib/persisted-cache-hydration branch from e49a0f7 to 414c593 Compare August 24, 2026 07:54
@Alae-Tamouh
Alae-Tamouh requested a review from jeromevdl August 24, 2026 07:58
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