Skip to content

fix(rm-costs): fix period filter not working after page reload with URL params#68

Merged
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/production-plan-and-chat-bot-ai
Jul 22, 2026
Merged

fix(rm-costs): fix period filter not working after page reload with URL params#68
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/production-plan-and-chat-bot-ai

Conversation

@ilramdhan

Copy link
Copy Markdown
Member
  • Fix stale closure in auto-select effect reading filters.period from a potentially outdated closure instead of the latest value. Added filtersPeriodRef to always read the most up-to-date period value, preventing the auto-select from overriding URL-provided period.

  • Fix useUrlState stateRef sync from useEffect to synchronous render-time assignment, ensuring setState updater always reads the latest state even when called from other effects in the same render cycle.

…RL params

- Fix stale closure in auto-select effect reading filters.period from
  a potentially outdated closure instead of the latest value. Added
  filtersPeriodRef to always read the most up-to-date period value,
  preventing the auto-select from overriding URL-provided period.

- Fix useUrlState stateRef sync from useEffect to synchronous render-time
  assignment, ensuring setState updater always reads the latest state
  even when called from other effects in the same render cycle.
@ilramdhan ilramdhan added this to the Costing Release Milestone milestone Jul 22, 2026
@ilramdhan ilramdhan self-assigned this Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 06:51
@ilramdhan ilramdhan added the bug Something isn't working label Jul 22, 2026
@ilramdhan ilramdhan added the fix label Jul 22, 2026

Copilot AI 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.

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

React Compiler's react-hooks/refs rule flags mutating stateRef.current
during render; move the assignment into a useEffect so it runs after
commit instead, fixing the frontend lint CI failure.
@ilramdhan
ilramdhan merged commit b2079a8 into mutugading:main Jul 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants