monarchmoney / mint-export-extension

Effortlessly export your Mint data to CSV.
MIT License
36 stars 3 forks source link

Errors Exporting Historical Data #61

Closed amcolash closed 8 months ago

amcolash commented 8 months ago

I tried exporting my data using this tool it mostly worked. However, I was unable to upload my data using the mint import tool in monarch. Upon closer inspection, I found that there were a ton of duplicated dates in the data. I ended up needing to remove all of the duplicate data and then things worked properly.

Here is an example of the issue. I found duplicate dates in nearly every csv file (16 of 19 accounts) image

I can provide more info if necessary. I got my issue fixed, but wanted to let the engineers know about this one!

I wrote a quick script (though just using a Set in the extension would likely help and do the same thing)

dedupe.js

const { readdirSync, readFileSync, writeFileSync, mkdirSync } = require('fs');
const { join } = require('path');

const files = readdirSync(__dirname);
const outdir = join(__dirname, 'out');

mkdirSync(outdir, { recursive: true });

files.forEach((f) => {
  if (f.endsWith('.csv')) {
    const path = join(__dirname, f);
    const outpath = join(outdir, f);

    const data = readFileSync(path, 'utf8').split('\n');
    const dataSet = new Set();

    data.forEach((d) => dataSet.add(d));

    console.log(f, data.length, dataSet.size, data.length - dataSet.size);

    const out = Array.from(dataSet).join('\n');
    writeFileSync(outpath, out);
  }
});
idpaterson commented 8 months ago

Was that exported with the latest version 1.0.7? I'll take a look but I think it's caused by #22.

idpaterson commented 8 months ago

Thank you for the script! That was helpful as a convenient way to verify the fix in #62. I suspect that Monarch will release this as 1.0.8 since it's a critical bug but you can also try it out early with the Installation from source instructions (here is the pull request source to build).

idpaterson commented 8 months ago

@amcolash It looks like version 1.0.8 is now available in the Chrome Web Store so your extension should update soon. If you would like to try another export I believe this release should have fixed the duplicate balance dates.

amcolash commented 7 months ago

Thanks for the update on this. Since I already got my data in, no need for me to try again but glad to help others in the future by logging this!