Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recurring transactions create and fix cache access #3598

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

maroux
Copy link
Contributor

@maroux maroux commented Jul 25, 2020

Fixes issue #3597

Root cause:

  • If there's a lot of accounts to calculate balances for, then recurring transactions create page
    doesn't load. Partly because it has to calculate a lot of balances, but partly because the cache
    isn't being used at all because date is new Cobra rather than say, end of month.

Changes in this pull request:

  • Change Steam balance calculator to always default cache using end of month. Since cache is
    'invalidated' upon any edit, there's no reason to use current datetime anywhere its not explicitly
    required by user flow.
  • Don't calculate balances for revenue / expense accounts since those are unbounded (similar to
    auto complete form).

Test Plan:

  1. Opened /recurring/create and it loaded fine (albeit slow).
  2. Reloaded and verified zero instances of Steam in logs => cache was used.
  3. Loaded accounts page, in a separate tab created a test transaction, reloaded accounts page, verified account balance was changed => cache was still invalidated correctly.

@JC5

@maroux maroux changed the title Fix recurring transactions create Fix recurring transactions create and fix cache access Jul 25, 2020
- If there's a lot of accounts to calculate balances for, then recurring transactions create page
  doesn't load. Partly because it has to calculate a lot of balances, but partly because the cache
  isn't being used at all because date is `new Date` rather than say, end of month.

Fix: Change Steam balance calculator to always default cache using end of month. Since cache is
'invalidated' upon any edit, there's no reason to use current datetime anywhere its not explicitly
required by user flow.
Fix: Don't calculate balances for revenue / expense accounts since those are unbounded.

Issue: firefly-iii#3597
@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@JC5 JC5 merged commit 3cda3b2 into firefly-iii:develop Jul 28, 2020
@maroux maroux deleted the fix_recurring_create branch December 31, 2020 01:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants