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

Update transaction repair tool to remove erroneous transaction errors #4464

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jfdoming
Copy link
Contributor

@jfdoming jfdoming commented Feb 27, 2025

Opening this now so I don't forget to merge it, but let's not merge before the release just in case. Will open a separate PR to fix the related bug.

To test:

  1. Add a split transaction with two children.
  2. Delete both children but not the parent.
  3. Hit "expand splits" and observe the crash (occurs as of 26/02).
  4. Manually navigate to /settings, hit "Repair transactions", and observe the message.
  5. Navigate back to the account you were previously in and observe the lack of crashes.

@actual-github-bot actual-github-bot bot changed the title Update transaction repair tool to remove erroneous transaction errors [WIP] Update transaction repair tool to remove erroneous transaction errors Feb 27, 2025
Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for actualbudget ready!

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

@jfdoming jfdoming changed the title [WIP] Update transaction repair tool to remove erroneous transaction errors Update transaction repair tool to remove erroneous transaction errors Feb 27, 2025
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 → 7.07 MB (-3.4 kB) -0.05%
Changeset
File Δ Size
src/components/settings/RepairTransactions.tsx 📈 +445 B (+9.59%) 4.53 kB → 4.97 kB
locale/en.json 📉 -14 B (-0.01%) 103.19 kB → 103.18 kB
locale/fr.json 📉 -558 B (-0.61%) 89.42 kB → 88.87 kB
locale/pt-BR.json 📉 -713 B (-0.61%) 113.53 kB → 112.83 kB
locale/de.json 📉 -723 B (-0.61%) 115.06 kB → 114.35 kB
locale/en-GB.json 📉 -678 B (-0.67%) 99.33 kB → 98.67 kB
locale/nl.json 📉 -685 B (-0.68%) 98.45 kB → 97.78 kB
locale/es.json 📉 -553 B (-0.88%) 61.13 kB → 60.58 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 4.35 MB → 4.35 MB (+445 B) +0.01%

Smaller

Asset File Size % Changed
static/js/de.js 115.06 kB → 114.35 kB (-723 B) -0.61%
static/js/pt-BR.js 113.53 kB → 112.83 kB (-713 B) -0.61%
static/js/nl.js 98.45 kB → 97.78 kB (-685 B) -0.68%
static/js/en-GB.js 99.33 kB → 98.67 kB (-678 B) -0.67%
static/js/fr.js 89.42 kB → 88.87 kB (-558 B) -0.61%
static/js/es.js 61.13 kB → 60.58 kB (-553 B) -0.88%
static/js/en.js 103.19 kB → 103.18 kB (-14 B) -0.01%

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/uk.js 111.11 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 86.21 kB 0%
static/js/wide.js 102.9 kB 0%
static/js/AppliedFilters.js 10.8 kB 0%
static/js/useAccountPreviewTransactions.js 1.69 kB 0%
static/js/ReportRouter.js 1.59 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 (+226 B) +0.02%
Changeset
File Δ Size
packages/loot-core/src/server/tools/app.ts 📈 +473 B (+14.21%) 3.25 kB → 3.71 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 (+226 B) +0.02%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@jfdoming jfdoming requested a review from matt-fidd February 27, 2025 02:54
@jfdoming jfdoming added this to the v25.4.0 milestone Feb 27, 2025
@jfdoming
Copy link
Contributor Author

^added to the next release to be extra clear

@jfdoming jfdoming added the do not merge Don't merge this!!! label Feb 27, 2025
Copy link
Contributor

coderabbitai bot commented Feb 27, 2025

Walkthrough

The PR introduces a new property, numNonParentErrorsFixed, across both client-side and server-side code to track non-parent or non-split transaction errors that have been fixed. In the desktop client’s RepairTransactions component, the rendering logic is updated to display a message when this count is greater than zero, and the condition that determines if no repairs are needed is modified to include this new count. On the server side, within the tools/fix-split-transactions method in app.ts, code is added to query and update transactions with errors that are not marked as parents, and the count of fixed errors is returned via numNonParentErrorsFixed. The corresponding type declarations in the ToolsHandlers interface are updated to include this new property.

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • youngcw
  • matt-fidd

📜 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 8b928b3 and a429b0d.

⛔ Files ignored due to path filters (1)
  • upcoming-release-notes/4464.md is excluded by !**/*.md
📒 Files selected for processing (3)
  • packages/desktop-client/src/components/settings/RepairTransactions.tsx (4 hunks)
  • packages/loot-core/src/server/tools/app.ts (1 hunks)
  • packages/loot-core/src/server/tools/types/handlers.d.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Functional
  • GitHub Check: Visual regression
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: Analyze
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (7)
packages/loot-core/src/server/tools/types/handlers.d.ts (1)

9-9: Interface type addition looks good!

The new numNonParentErrorsFixed property is correctly typed as a number and maintains consistency with the naming convention of other count properties in the interface.

packages/loot-core/src/server/tools/app.ts (2)

95-104: Implementation for removing errors from non-parent transactions looks good!

The implementation follows the same pattern as other repair operations in this file. The SQL query correctly identifies transactions with errors that aren't parents, and the mutator appropriately clears the errors.


110-110: Return value properly updated

The new count is correctly included in the return object, matching the interface declaration.

packages/desktop-client/src/components/settings/RepairTransactions.tsx (4)

28-28: Property addition looks good

The new property is correctly destructured from the results object.


37-37: Condition update is correct

The condition for determining if no repairs are needed has been properly updated to include checking if the new count is zero.


63-69: Display logic for fixed non-parent transactions looks good

The new conditional block for displaying results follows the same pattern as the existing blocks and correctly uses the translation function.


166-169: Documentation updated correctly

The new list item in the description accurately explains the new functionality for checking and removing erroneous split errors from non-split transactions.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@matt-fidd matt-fidd left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Don't merge this!!! ✅ Approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants