Skip to content
goodprompts

Frontend state audit prompt for reviewing app code

Asks a model to audit a frontend codebase for state ownership, race conditions, caching, optimistic updates and navigation issues, and report prioritised fixes and tests.

CodingSuggested models Any LLMby @Sujay__Raj on X

The prompt

3,516 characters
Act as a Senior Frontend Architect specialising in state management, asynchronous operations and data consistency. Audit how my application manages frontend state across components, pages, API requests, navigation and user interactions. Inspect the actual codebase and trace important state changes from user action to server response and back to the UI. STEP 1: MAP STATE OWNERSHIP -Identify local component state and shared application state. -Review context providers, state stores and server-state libraries. -Identify duplicated sources of truth. -Check whether the same data is stored independently in multiple places. -Review how state is initialised and reset. -Identify state that should be derived instead of stored separately. STEP 2: AUDIT ASYNCHRONOUS REQUESTS -Find requests that can finish in a different order from how they started. -Check whether older responses can overwrite newer data. -Review request cancellation when users navigate away. -Identify duplicate API calls. -Check loading, success and error state transitions. -Review what happens when requests time out or fail. -Check whether components update after they are no longer relevant. STEP 3: REVIEW CACHING AND DATA UPDATES -Identify cached server data. -Review cache invalidation after create, update and delete operations. -Check whether related pages display stale information. -Review pagination, sorting and filtering after data changes. -Check whether refresh and navigation show the correct latest data. -Identify inconsistent state between different components. STEP 4: CHECK OPTIMISTIC UI BEHAVIOUR -Identify actions that update the UI before the server confirms success. -Check whether failed requests correctly roll back optimistic updates. -Review rapid clicks and repeated submissions. -Check whether counters and status indicators can become incorrect. -Verify whether users receive clear feedback when an action fails. -Identify actions that appear successful even when the server rejected them. STEP 5: REVIEW NAVIGATION AND MULTI-TAB BEHAVIOUR -Check browser back and forward navigation. -Review state restoration after page refresh. -Check whether URL parameters match displayed filters and pagination. -Identify stale forms or drafts after navigation. -Review what happens when the same account is used in multiple tabs. -Check whether session changes are reflected consistently. STEP 6: TEST EDGE CASES Test or propose tests for: -Rapid repeated clicks. -Slow and out-of-order API responses. -Failed requests after optimistic updates. -Refreshing during an operation. -Navigating away before a request completes. -Changing filters while data is loading. -Multiple tabs modifying the same information. -Empty responses and missing fields. -Reconnecting after a network interruption. IMPORTANT RULES: -Don't replace the state management library just for preference. -Don't assume every duplicated value is a bug. -Don't change backend business rules during a frontend audit. -Preserve existing user workflows. -Don't claim a race condition is confirmed without evidence. -Don't introduce unnecessary global state. FINAL DELIVERABLE: 1. Frontend state architecture overview. 2. Duplicate and conflicting state report. 3. Stale data and race condition findings. 4. Optimistic update and rollback issues. 5. Cache invalidation problems. 6. Prioritised fixes with affected components. 7. Test cases for reliable UI state. For every issue, explain what the user sees, why it happens and how to fix it.
3,516 characters

About this prompt

Category
Coding
Suggested models
Any LLM
Published
Nov 22, 2026

Is this your post? Email [email protected] to ask us to remove this prompt.

Tags
#debugging#state-management#frontend#code-audit#race-conditions

published by @finds

Comments

Details

Category
Coding
Suggested models
Any LLM
Published
Nov 22, 2026

Is this your post? Email [email protected] to ask us to remove this prompt.

Tags
#debugging#state-management#frontend#code-audit#race-conditions
Published byGoodPrompts Finds@finds · 76 published
View profile

Comments

No comments yet.

More like this

Planning and building a data animation explainer as a canvas HTML fileCodingAudit third-party API integrations for reliability and failure risksCodingReview a pull request for scope creep and risksCodingDesign a system architecture for an appCoding4 blanksAudit a codebase for authorization and tenant isolation flawsCoding