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

Bug: Line chart is not updating end date #940

Closed
scubamaggo opened this issue Jul 2, 2024 · 5 comments
Closed

Bug: Line chart is not updating end date #940

scubamaggo opened this issue Jul 2, 2024 · 5 comments
Labels
🐛 Bug Something isn't working

Comments

@scubamaggo
Copy link
Contributor

scubamaggo commented Jul 2, 2024

Describe the bug
It appears that the line chart is not updating the end date when the application is running for longer periods. It is stuck on the date when the application was started.

To Reproduce
Steps to reproduce the behavior:

  1. Go to an Account with a transaction history. The last date will be the current date.
  2. Wait until the next day.
  3. The end date is stuck on the date seen in step 1 and will not update unless the app is restarted(?).

Expected behavior
The end date should be refreshed when the server date changes.

Additional context
I suspect this is due to the way the Period class is initialized. The class contains this code:

    BUILTIN = [
        new(name: "all", date_range: nil..Date.current),
        new(name: "last_7_days", date_range: 7.days.ago.to_date..Date.current),
        new(name: "last_30_days", date_range: 30.days.ago.to_date..Date.current),
        new(name: "last_365_days", date_range: 365.days.ago.to_date..Date.current)
    ]

    INDEX = BUILTIN.index_by(&:name)

This is called once upon class initialization, and I suspect this class is never(?) instantiated again via the provided chart methods.

@scubamaggo scubamaggo added the 🐛 Bug Something isn't working label Jul 2, 2024
@zachgoll
Copy link
Collaborator

zachgoll commented Jul 8, 2024

Does manually syncing the account fix the chart?

@scubamaggo
Copy link
Contributor Author

No, it does not. The chart remains on the date the docker container was started (or the account created? not sure).

image

@mamarguerat
Copy link

With the last built image, on my instance, it does update the chart when syncing the account. @scubamaggo Looking at your screenshot, you don't run the last commit as you still have the bug with the EUR total value.

@scubamaggo
Copy link
Contributor Author

Thank you, good point. I haven't confirmed latest releases after the initial occurrence. Will do.

@zachgoll
Copy link
Collaborator

@scubamaggo the most recent build should have fixes for this. I'll go ahead and close this out as I'm fairly confident things will work for you on upgrade, but feel free to re-open if you find otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants