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 crash when undoing a rule application #1885

Merged

Conversation

jfdoming
Copy link
Contributor

@jfdoming jfdoming commented Nov 9, 2023

Fix crash when hitting undo after applying a rule to some transactions (closes #1831).

Question: This fix exposes some weird (pre-existing) behaviour, where hitting undo for a rule-apply causes the application to send you to the rules page with no modal open, which is confusing as you do not see the transactions you are undoing the change for. We could:

  1. Send the user to the rules page AND open the "Edit rule" modal again, showing the previously-applied transactions.
  2. Send the user to the transactions page with the previously-edited transactions selected.
    IMHO 1 makes more sense and would be easier to implement, but I'm curious which you think is better! A similar issue also exists on the Payees page.

Copy link

netlify bot commented Nov 9, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 05760d2
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/655bfe806207c80009b8f97f
😎 Deploy Preview https://deploy-preview-1885.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 force-pushed the jfdoming/rules-modal-undo-crash-fix branch from d70c655 to ca3a778 Compare November 9, 2023 06:01
Copy link
Contributor

github-actions bot commented Nov 9, 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.97 MB → 2.97 MB (+7 B) +0.00%
Changeset
File Δ Size
src/components/ManageRules.tsx 📈 +37 B (+0.32%) 11.23 kB → 11.27 kB
src/components/Modals.tsx 📈 +1 B (+0.01%) 10.27 kB → 10.27 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/main.js 1.16 MB → 1.16 MB (+7 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/444.chunk.js 156.11 kB 0%
static/js/wide-components.chunk.js 117.61 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/reports.chunk.js 74.37 kB 0%
static/js/narrow-components.chunk.js 52.67 kB 0%
static/js/301.chunk.js 13.31 kB 0%
static/js/473.chunk.js 13 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%

Copy link
Contributor

github-actions bot commented Nov 9, 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 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
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@joel-jeremy
Copy link
Contributor

@jfdoming Thank you for creating a fix! I can verify that this fixes the issue but I can't seem to replicate the behavior mentioned in your question. Could you create an issue for it and provide some steps to reproduce? We can merge this PR and handle the other issue on a separate one.

@@ -137,7 +137,7 @@ export default function Modals() {
return (
<ManageRulesModal
modalProps={modalProps}
payeeId={options.payeeId}
payeeId={options?.payeeId}
Copy link
Member

Choose a reason for hiding this comment

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

❓ question: ‏is this change necessary? Doesn't the change in ManageRules.tsx already solve the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not strictly necessary, but modals.d.ts in loot-core lists payeeId as optional, so I thought it would make sense to match here!

Copy link
Member

Choose a reason for hiding this comment

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

That makes sense. Thanks for explaining!

@jfdoming
Copy link
Contributor Author

@jfdoming Thank you for creating a fix! I can verify that this fixes the issue but I can't seem to replicate the behavior mentioned in your question. Could you create an issue for it and provide some steps to reproduce? We can merge this PR and handle the other issue on a separate one.

Sounds good! I added one here: #1945

@jfdoming jfdoming requested a review from MatissJanis November 21, 2023 00:49
@joel-jeremy joel-jeremy merged commit cd6bd9e into actualbudget:master Nov 21, 2023
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved ✨ Merged Pull Request has been merged successfully labels Nov 21, 2023
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
* Undo shouldn't open modal if it wasn't open before

* Add release notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Undo after applying a rule gives error
3 participants