Skip to content

[WS-2211][SPIKE] UAS Activity reliability strategy using Tanstack Query#13934

Draft
elvinasv wants to merge 4 commits intolatestfrom
WS-2211-uas-activity-caching-and-retry-strategy
Draft

[WS-2211][SPIKE] UAS Activity reliability strategy using Tanstack Query#13934
elvinasv wants to merge 4 commits intolatestfrom
WS-2211-uas-activity-caching-and-retry-strategy

Conversation

@elvinasv
Copy link
Copy Markdown
Member

@elvinasv elvinasv commented Apr 21, 2026

Resolves JIRA: https://bbc.atlassian.net/browse/WS-2211

Summary

This pull request introduces TanStack Query v5 to manage server state for UAS (User Account System) save status, including query persistence and improved mutation handling

Associated SPIKE document with more details: https://www.dropbox.com/scl/fi/rg7qzngkl4pimk29psrsq/UAS-Activity-API-Client-Side-Reliability-Strategy-Spike.paper?rlkey=pm5qguvnl6lp56s07oh32opsm&dl=0

Testing instructions:
https://github.com/bbc/simorgh-infrastructure/blob/create-doc-on-UAS-testing-locally/documentation/testing-simorgh-uas-endpoints-locally.md

@elvinasv elvinasv self-assigned this Apr 21, 2026
Copy link
Copy Markdown
Contributor

@andrewscfc andrewscfc left a comment

Choose a reason for hiding this comment

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

Implemenation LGTM


export default loadable(
() =>
import(
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.

ah will this ensure lazy loading of tanstack?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, I updated both the SaveArticleButton and QueryContext to be lazy loaded for that reason. We'll double-check that in the preview environment before moving forward.

Comment thread src/app/contexts/QueryContext/lazy.tsx
Comment thread src/app/pages/ArticlePage/ArticlePage.tsx
});

const persister = createAsyncStoragePersister({
storage: typeof window !== 'undefined' ? window.sessionStorage : undefined,
Copy link
Copy Markdown
Member Author

@elvinasv elvinasv Apr 24, 2026

Choose a reason for hiding this comment

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

Note: We could also use localStorage instead. With the sessionStorage the state would be out of sync if two tabs are opened (since tabs/windows have different session scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants