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

Goals: speed up and a bugfix #1718

Merged
merged 4 commits into from
Sep 21, 2023
Merged

Goals: speed up and a bugfix #1718

merged 4 commits into from
Sep 21, 2023

Conversation

youngcw
Copy link
Member

@youngcw youngcw commented Sep 21, 2023

Fixed a bug where report budget income templates would compound instead of replacing previous values.

Fixed an issue where the list of budgeted values to apply to the db would persist between priority runs. This caused every processed template to be applied again in all future priority runs. That wasn't very noticeable when accessing locally, but on slower networks it would bog down the process a lot as each db change would be sent to the server.

@netlify
Copy link

netlify bot commented Sep 21, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 949c182
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/650bbc2889c79100083d124c
😎 Deploy Preview https://deploy-preview-1718.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2023

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
16 2.48 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/main.js 1.11 MB 0%
static/js/678.chunk.js 420.74 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/713.chunk.js 156.56 kB 0%
static/js/wide-components.chunk.js 126.98 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/narrow-components.chunk.js 35.15 kB 0%
static/js/reports.chunk.js 29.23 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/389.chunk.js 12.76 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 903 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2023

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
2 2.22 MB → 2.22 MB (-16 B) -0.00%
Changeset
File Δ Size
packages/loot-core/src/server/budget/goaltemplates.ts 📉 -16 B (-0.05%) 31.98 kB → 31.96 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
kcab.worker.js 1.23 MB → 1.23 MB (-16 B) -0.00%

Unchanged

Asset File Size % Changed
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@shall0pass
Copy link
Contributor

shall0pass commented Sep 21, 2023

Was this a bug?

If you have two templates in a category,

#template 30
#template 60

The standard rollover budget would fill 90 for this. With this change, the report budget will only fill 30.

@youngcw
Copy link
Member Author

youngcw commented Sep 21, 2023

It works as expected in all my tests. Remember that the current budgeted value gets passed into applyCategoryTemplates (ln248). That prev_budgeted value is the starting value for the template return so it won't get missed.

So the standard processing already returns a value that includes the previous pass(es) budgeted value. So what was happening, assuming 3 priority passes.
pass 1. write pass 1
pass 2. write pass 1 then overwrite with pass 2
pass 3. write pass 1 then overwrite with pass 2 then overwrite with pass 3.

The db was getting written and overwritten a whole bunch. Even if the priority pass didn't have any new actions on a category, that category would be written to the db again because the action was still in the list from before.

@shall0pass
Copy link
Contributor

I just tried my example again, and it works correctly. Weird! It didn't do that earlier for me, so maybe I had something strange on my system.

@shall0pass shall0pass merged commit 49ab358 into actualbudget:master Sep 21, 2023
17 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Sep 21, 2023
@youngcw youngcw deleted the goal_speedup branch September 21, 2023 17:32
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
* speed up and a bug fix

* cleanup

* note

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants