refactor(frontend): consolidate account-overrides prefetch helper (closes #198) by cristim · Pull Request #852 · LeanerCloud/cloud-commitments-cli · GitHub
Skip to content

refactor(frontend): consolidate account-overrides prefetch helper (closes #198) - #852

Merged
cristim merged 2 commits into
mainfrom
fix/198-wave15
Jul 19, 2026
Merged

cristim merged 2 commits into
mainfrom
fix/198-wave15

Conversation

@cristim

@cristim cristim commented May 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Extract fetchOverridesForAccounts() into frontend/src/lib/overrides.ts, replacing two near-identical inline Promise.all prefetch blocks in openFanOutModal and openPurchaseModal
  • Both callers now use a single 1-line await; the helper is 100% covered by existing tests
  • Add one extra await Promise.resolve() tick in the mixed-SP DOM test to account for the extra async function boundary introduced by the new helper

Test plan

  • npx tsc --noEmit -- clean
  • npm test -- 65 suites, 2142 passed, 1 pre-existing skip, 0 failures
  • src/lib/overrides.ts shows 100% statement/branch/function/line coverage

Summary by CodeRabbit

  • Bug Fixes
    • Improved modal rendering reliability in bulk purchase and fan-out flows, ensuring DOM content is populated before validations and UI state checks.
  • Refactor
    • Consolidated account service overrides fetching into a shared helper used across purchase-modal and fan-out-modal flows.
  • Tests
    • Reduced flakiness by adding an extra microtask tick in recommendations async modal tests before asserting DOM content.

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/internal Team-internal only effort/xs Trivial / one-liner type/chore Maintenance / non-user-visible labels May 28, 2026
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

@cristim

cristim commented May 28, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@cristim

cristim commented May 30, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@cristim

cristim commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@cristim have exceeded the limit for the number of chat messages per hour. Please wait 39 minutes and 42 seconds before sending another message.

@cristim

cristim commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim changed the base branch from feat/multicloud-web-frontend to main June 9, 2026 15:44
@cristim

cristim commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

cristim added 2 commits July 17, 2026 21:29
…oses #198)

Extract fetchOverridesForAccounts() into frontend/src/lib/overrides.ts,
replacing two near-identical inline Promise.all blocks in openFanOutModal
and openPurchaseModal. Update the mixed-SP DOM test for the extra async
boundary introduced by the new function.
fetchOverridesForAccounts adds one extra async boundary vs the old
inline Promise.all; DOM-querying tests in #111 (issue j) and #132
(mixed-SP, umbrella-SP) need 4 Promise.resolve() ticks, not 3.
@cristim
cristim merged commit 68e361d into main Jul 19, 2026
20 checks passed
@cristim
cristim deleted the fix/198-wave15 branch July 27, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/internal Team-internal only priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant