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

add last bank sync tracking back in #4472

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

matt-fidd
Copy link
Contributor

Looks like this was accidentally removed in #4227

@matt-fidd matt-fidd added this to the v25.3.0 milestone Feb 27, 2025
@actual-github-bot actual-github-bot bot changed the title add last bank sync tracking back in [WIP] add last bank sync tracking back in Feb 27, 2025
@matt-fidd matt-fidd requested a review from youngcw February 27, 2025 18:59
Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 0214da6
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67c0bd5a712ea400080f81f2
😎 Deploy Preview https://deploy-preview-4472.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.

@youngcw
Copy link
Member

youngcw commented Feb 27, 2025

Functions as expected

Copy link
Contributor

github-actions bot commented Feb 27, 2025

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
18 7.07 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/es.js 60.58 kB 0%
static/js/en.js 103.18 kB 0%
static/js/nl.js 97.78 kB 0%
static/js/en-GB.js 98.67 kB 0%
static/js/de.js 114.35 kB 0%
static/js/fr.js 88.87 kB 0%
static/js/pt-BR.js 112.83 kB 0%
static/js/uk.js 111.11 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/useAccountPreviewTransactions.js 1.69 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/AppliedFilters.js 10.8 kB 0%
static/js/wide.js 102.9 kB 0%
static/js/narrow.js 86.23 kB 0%
static/js/ReportRouter.js 1.59 MB 0%
static/js/index.js 4.35 MB 0%

Copy link
Contributor

github-actions bot commented Feb 27, 2025

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
1 1.34 MB → 1.34 MB (+99 B) +0.01%
Changeset
File Δ Size
packages/loot-core/src/server/accounts/app.ts 📈 +151 B (+0.63%) 23.33 kB → 23.47 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.34 MB → 1.34 MB (+99 B) +0.01%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@matt-fidd matt-fidd changed the title [WIP] add last bank sync tracking back in add last bank sync tracking back in Feb 27, 2025
Copy link
Contributor

coderabbitai bot commented Feb 27, 2025

Walkthrough

The changes update the handleSyncResponse function in packages/loot-core/src/server/accounts/app.ts to be asynchronous. Its signature now returns a Promise<SyncResponse> instead of a direct SyncResponse. Inside the function, a new code block captures the current timestamp and updates the last_sync field in the database for the given account using an asynchronous query. The existing logic for processing the added and updated transactions remains unchanged. Additionally, the functions accountsBankSync and simpleFinBatchSync have been modified to await the asynchronous result of handleSyncResponse, ensuring that the asynchronous database operation is properly handled.

Possibly related PRs

Suggested labels

::sparkles: Merged

Suggested reviewers

  • youngcw
  • joel-jeremy

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0573456 and 0214da6.

📒 Files selected for processing (1)
  • packages/loot-core/src/server/accounts/app.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/loot-core/src/server/accounts/app.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Visual regression
  • GitHub Check: Functional
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (ubuntu-latest)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/loot-core/src/server/accounts/app.ts (1)

650-653: Functionality for tracking last bank sync restored.

This code properly restores the functionality for tracking when an account was last synced with the bank by updating the last_sync field in the database with the current timestamp.

A minor suggestion would be to use Date.now() instead of new Date().getTime() for better readability, but both approaches work identically.

-const ts = new Date().getTime().toString();
+const ts = Date.now().toString();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f50c73 and 0573456.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/4472.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • packages/loot-core/src/server/accounts/app.ts (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Visual regression
  • GitHub Check: Functional
🔇 Additional comments (3)
packages/loot-core/src/server/accounts/app.ts (3)

631-637: Function signature updated correctly to async.

The function signature has been properly updated to be asynchronous, which is necessary for the database operation that will be added.


752-752: Properly awaiting the now asynchronous function.

The call to handleSyncResponse has been correctly updated to await the result since the function now returns a Promise.


855-858: Properly awaiting the now asynchronous function in SimpleFin sync.

The call to handleSyncResponse has been correctly updated to await the result since the function now returns a Promise.

@youngcw
Copy link
Member

youngcw commented Feb 27, 2025

wait. The new "last sync" value doesn't seem to be getting sent back to my main server. I can make new transactions and that is getting synced as expected, but the "last sync" isn't making it across.

@matt-fidd
Copy link
Contributor Author

wait. The new "last sync" value doesn't seem to be getting sent back to my main server. I can make new transactions and that is getting synced as expected, but the "last sync" isn't making it across.

Screen.Recording.2025-02-27.at.19.25.29.mov

@youngcw
Copy link
Member

youngcw commented Feb 27, 2025

wait. The new "last sync" value doesn't seem to be getting sent back to my main server. I can make new transactions and that is getting synced as expected, but the "last sync" isn't making it across.

Screen.Recording.2025-02-27.at.19.25.29.mov

Yes, that value is updating. The value that isn't updating is on my main instance. I can run the demo, connect to my server, bank sync on the demo, and see that the last sync time updates in the demo. Its just that the new value never shows up on my production view. It still says the 19th after may syncs to the server

@youngcw
Copy link
Member

youngcw commented Feb 27, 2025

Much better 🙂

@matt-fidd
Copy link
Contributor Author

Much better 🙂

Good catch, thank you

@matt-fidd matt-fidd merged commit 1c931cf into actualbudget:master Feb 27, 2025
21 checks passed
@matt-fidd matt-fidd deleted the last-sync-ts branch February 27, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants