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 electron export issue #1242

Merged
merged 7 commits into from
Jul 2, 2023
Merged

Conversation

Shazib
Copy link
Contributor

@Shazib Shazib commented Jul 1, 2023

Solves #1238

If we are happy with this approach, which I don't love, I'll tidy it up a bit first, check the file doesn't exist, use a random(er) name, wrap it in a functon etc.

Basically the better-sqlite serialize function can't be used, as I guess under the surface its allocating a chunk of memory in C.

I tried to wrap all this logic inside the exportDatabase function in /server/sqlite/index.electron.ts but I had a lot of problems trying to import fs there if anyone can give advice.

@trafico-bot trafico-bot bot added the 🚧 WIP label Jul 1, 2023
@netlify
Copy link

netlify bot commented Jul 1, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit a4dca24
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/64a06f2d9b3bda0008969406
😎 Deploy Preview https://deploy-preview-1242--actualbudget.netlify.app
📱 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 Jul 1, 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
13 2.34 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.04 MB 0%
static/js/457.chunk.js 387.21 KB 0%
static/media/Inter.var.woff2 317.25 KB 0%
static/media/Inter-italic.var.woff2 239.29 KB 0%
static/media/Inter-roman.var.woff2 221.86 KB 0%
static/media/bg.svg 116.73 KB 0%
static/js/reports.chunk.js 19.58 KB 0%
static/js/969.chunk.js 12.94 KB 0%
static/js/resize-observer-polyfill.chunk.js 8.12 KB 0%
static/css/main.css 6.08 KB 0%
index.html 1.68 KB 0%
asset-manifest.json 1.47 KB 0%
static/media/browser-server.js 963 B 0%

@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 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 1.97 MB -> 1.97 MB (+12 B) +0.00%
Changeset
File Δ Size
packages/loot-core/src/platform/server/sqlite/index.web.ts 📈 +6 B (+0.13%) 4.67 KB -> 4.68 KB
packages/loot-core/src/server/cloud-storage.ts 📈 +6 B (+0.05%) 10.68 KB -> 10.69 KB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1014.86 KB -> 1014.87 KB (+12 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
xfo.xfo.kcab.worker.js 1004.04 KB 0%

@j-f1
Copy link
Contributor

j-f1 commented Jul 1, 2023

This seems like a reasonable approach. You should be able to use a function like mktemp or similar to generate a unique temporary file name.

@Shazib
Copy link
Contributor Author

Shazib commented Jul 1, 2023

I went with uuid in the end because i don't want to drag in another npm pacakge for mktemp

@Shazib Shazib changed the title [WIP] Fix electron export issue Fix electron export issue Jul 1, 2023
@j-f1 j-f1 merged commit 7a5bf2f into actualbudget:master Jul 2, 2023
15 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Jul 2, 2023
@Shazib Shazib deleted the fix-electron-export branch July 2, 2023 19:16
TomAFrench added a commit to TomAFrench/actual that referenced this pull request Jul 4, 2023
* master: (34 commits)
  chore: add types to `crdt` package (actualbudget#1076)
  Fix layout of the management app with the demo bar in place (actualbudget#1267)
  ♻️ (select) removing 2x usages of the Select component (actualbudget#1259)
  Fix transaction list scrolling behavior (actualbudget#1260)
  🐛  fix link-schedule option in transaction table (actualbudget#1250)
  cleared/uncleared background update (actualbudget#1265)
  Fix calculation of how many table rows to render (actualbudget#1262)
  ♻️  moving more components out of common.tsx (actualbudget#1257)
  ♻️  moving some components from common.tsx to separate files (actualbudget#1248)
  🐛  fix toggling of balances in all-accounts view (actualbudget#1252)
  🐛 (mobile) reduce the size of account cards (actualbudget#1247)
  Fix electron export issue (actualbudget#1242)
  Saved Filters Page (actualbudget#1122)
  🔧  cancel previous CI runs if a new push is made (actualbudget#1251)
  .gitattributes Check line endings for tsx files (actualbudget#1246)
  Fix importing transfers from YNAB4/5 (actualbudget#1224)
  Auto-close the local/nordigen picker modal after creating an account (actualbudget#1219)
  Run “Handle completed feature requests” in pull_request_target (actualbudget#1243)
  Add electron options to bug-report.yml (actualbudget#1239)
  Add onClick handlers to the schedule and transaction icons in the transaction list (actualbudget#1228)
  ...
@Shazib Shazib mentioned this pull request Aug 5, 2023
22 tasks
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
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