scastiel / protonmail-export

Export your ProtonMail e-mails. DEPRECATED, prefer ProtonMail Bridge: https://protonmail.com/bridge
54 stars 9 forks source link

Cannot read property 'reduce' of undefined #3

Closed mat-mcloughlin closed 7 years ago

mat-mcloughlin commented 7 years ago

Hey, when I attempt to run this I get the following error

TypeError: Cannot read property 'reduce' of undefined
    at ConversationsFetcher._callee2$ (C:\Users\mathe\AppData\Roaming\npm\node_modules\protonmail-export\dist\ConversationFetcher.js:112:69)
    at tryCatch (C:\Users\mathe\AppData\Roaming\npm\node_modules\protonmail-export\node_modules\regenerator-runtime\runtime.js:64:40)
    at Generator.invoke [as _invoke] (C:\Users\mathe\AppData\Roaming\npm\node_modules\protonmail-export\node_modules\regenerator-runtime\runtime.js:299:22)
    at Generator.prototype.(anonymous function) [as next] (C:\Users\mathe\AppData\Roaming\npm\node_modules\protonmail-export\node_modules\regenerator-runtime\runtime.js:116:21)
    at step (C:\Users\mathe\AppData\Roaming\npm\node_modules\protonmail-export\dist\ConversationFetcher.js:27:191)
    at C:\Users\mathe\AppData\Roaming\npm\node_modules\protonmail-export\dist\ConversationFetcher.js:27:361
    at process._tickCallback (internal/process/next_tick.js:109:7)

On further investigation I get a Client upgrade required exception on the context. Unfortunately I don't know enough on how to fix this so I was hoping you could help me out

Thanks

keitharogers commented 7 years ago

@mat-mcloughlin - I fixed this and raised a pull request to @scastiel repository but he obviously hasn't seen it yet.

See my pull request here: https://github.com/scastiel/protonmail-export/pull/2

Alternatively, simply use the version I have on my fork located here: https://github.com/devopper/protonmail-export

Hope this helps.

scastiel commented 7 years ago

My bad I totally forgot your pull request, I haven't had the time to test it yet, that's why it's not accepted. I'll deal with it in the next few days.

mat-mcloughlin commented 7 years ago

It seems to negate the error mentioned but I'm now hitting a problem where the body of a lot of my emails is undefined

for example

Return-Path: <contact@protonmail.ch>
X-Original-To: xxx
Received: from mail.protonmail.ch by mail.protonmail.ch; Fri, 10 Mar 2017 17:51:25 -0500
X-Pm-Origin: internal
Subject: Introducing ProtonVPN, a new security-focused VPN
To :xxx
From: ProtonMail Team <contact@protonmail.ch>
Date: Fri, 10 Mar 2017 17:51:25 -0500
Mime-Version: 1.0
Content-type: text/html; charset=UTF-8

undefined

Not sure if the two are related

keitharogers commented 7 years ago

@scastiel : No problem, I know how it goes :)

@mat-mcloughlin : I didn't have the issue you mentioned above. After fixing the API version (as shown in my pull request) the application worked perfectly for me and I was able to download all of my e-mails as intended.

scastiel commented 7 years ago

@devopper I merged your pull-request, thanks :)

@mat-mcloughlin could you see if your problem is fixed, and if it's not maybe create a new issue?

mat-mcloughlin commented 7 years ago

Ok I'll have a check @scastiel

Have you pushed a new release?