Skip to content

fix: resolve CashFlowForecast infinite re-render and auth token key - #639

Open
Ranjeet2063 wants to merge 1 commit into
Protocol-Guild:mainfrom
Ranjeet2063:fix/cash-flow-auth-542
Open

Ranjeet2063 wants to merge 1 commit into
Protocol-Guild:mainfrom
Ranjeet2063:fix/cash-flow-auth-542

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary

Fixes the broken CashFlowForecast page by resolving the infinite re-render loop on mount and ensuring API requests send the correct authorization token.

Changes

  • Fix infinite re-render: Removed the useEffect block that was blindly calling loadForecast() on mount. Because loadForecast depends on params (which update on every keystroke), the effect was triggering an infinite render loop and showing a spurious error toast immediately before the user could enter anything.
  • Fix auth token key: Updated cashFlowForecastApi.ts to correctly read the bearer token from localStorage.getItem('payd_auth_token') instead of the non-existent accessToken key. API calls now authenticate properly instead of failing with 401 Unauthorized.

Closes #542

Copilot AI balanced review requested due to automatic review settings October 2, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- Remove auto-fetching `useEffect` that was triggering an infinite render loop (due to `params` in `loadForecast` deps) and showing an immediate error toast on mount
- Update API service to read the bearer token from `payd_auth_token` instead of the non-existent `accessToken` key

Closes Protocol-Guild#542
@Ranjeet2063
Ranjeet2063 force-pushed the fix/cash-flow-auth-542 branch from 2d6be8c to b1f51a3 Compare October 2, 2026 19:41
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.

Fix CashFlowForecast infinite re-render risk and wrong auth token key

2 participants