Skip to content

All Charges screen performance boost: Tame invalidLedger + memoize getChargeType#4031

Open
gilgardosh wants to merge 2 commits into
mainfrom
all-charges-performance-boost-4
Open

All Charges screen performance boost: Tame invalidLedger + memoize getChargeType#4031
gilgardosh wants to merge 2 commits into
mainfrom
all-charges-performance-boost-4

Conversation

@gilgardosh

Copy link
Copy Markdown
Collaborator

No description provided.

@gilgardosh gilgardosh self-assigned this Jul 22, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@gilgardosh
gilgardosh requested a review from Copilot July 22, 2026 14:29
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 14:29 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 14:29 — with GitHub Actions Inactive
@gilgardosh gilgardosh changed the title Tame invalidLedger + memoize getChargeType All Charges screen performance boost: Tame invalidLedger + memoize getChargeType 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.

Pull request overview

This PR improves server-side charge classification and ledger-validation performance by memoizing derived charge types per request and short-circuiting invalidLedger for trivially-empty common charges, reducing unnecessary ledger-generation work.

Changes:

  • Pass full charge rows into ledger-lock meta helpers to enable the enriched/aggregate fast-path.
  • Add an invalidLedger early-return for empty Common/CreditcardBank charges to skip ledger generation when it’s guaranteed to be a no-op.
  • Memoize derived (null-DB-typed) charge types per request via an injector-keyed cache to avoid repeated derivations during GraphQL type resolution.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/server/src/modules/ledger/helpers/ledger-lock.ts Uses charge-row-based meta helpers to compute lock dates more efficiently (enriched fast-path).
packages/server/src/modules/charges/resolvers/charges.resolver.ts Adds an “empty charge” short-circuit in invalidLedger to skip expensive ledger generation.
packages/server/src/modules/charges/helpers/charge-type.ts Adds request-scoped memoization for derived charge types (null type).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/server/src/modules/charges/resolvers/charges.resolver.ts Outdated
@gilgardosh
gilgardosh force-pushed the all-charges-performance-boost-3 branch 3 times, most recently from 01225f5 to 17a8543 Compare July 22, 2026 14:43
@gilgardosh
gilgardosh force-pushed the all-charges-performance-boost-4 branch from 204723c to a40dd82 Compare July 22, 2026 14:44
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 14:44 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 14:44 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 15:00 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 15:01 — with GitHub Actions Inactive
Base automatically changed from all-charges-performance-boost-3 to main July 22, 2026 15:01
@gilgardosh
gilgardosh force-pushed the all-charges-performance-boost-4 branch from 6bf7fd3 to 0844fc1 Compare July 22, 2026 15:02
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 15:02 — with GitHub Actions Inactive
@gilgardosh
gilgardosh temporarily deployed to accounter-fullstack July 22, 2026 15:02 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@accounter/client 0.1.0-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/gmail-listener 0.1.3-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/israeli-vat-scraper 0.1.13-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/modern-poalim-scraper 0.10.7-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/scraper-app 0.0.3-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/server 0.2.0-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/shaam-uniform-format-generator 0.2.7-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎
@accounter/shaam6111-generator 0.1.9-alpha-20260722150420-ec76c562e791e234601249ebec730d137ee85c37 npm ↗︎ unpkg ↗︎

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.

2 participants