bunqCommunity / bunqDesktop

The unofficial, free and open source desktop application for the bunq API
https://bunqdesk.top
MIT License
272 stars 53 forks source link

Something went wrong when viewing payment information of type SWIFT #505

Closed benv666 closed 5 years ago

benv666 commented 5 years ago

I was trying out the desktop app, works fine for all but one of the payments I tried to view. This one seems special, every time I try to view details it gives the "Something went wrong" error.

I'm guessing the type "SWIFT" makes this special, having certain values null which are expected to be there?

The error gives:

Something went wrong!
TypeError: Cannot read property 'length' of null
    at b (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/bunqDesktop.js:6:3648)
    at A.value (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/paymentinfo.bundle.js:132:7239)
    at Aa (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:62919)
    at Ia (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:67803)
    at di (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:77380)
    at pi (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:77687)
    at Gi (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:81235)
    at Ki (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:80747)
    at zi (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:80573)
    at Vi (file:///C:/Users/BenV/AppData/Local/Programs/bunqdesktop/resources/app.asar/app/react/vendor.bundle.js:3120:79946)

Q/A:

Crecket commented 5 years ago

Thanks for reporting

After having a quick look, I'm guessing that SWIFT payments sometimes don't have a description and thus the description.length > 0 check is failing.

benv666 commented 5 years ago

Went into debug mode, seems like the description is there, here's a somewhat redacted screenshot. If there's anything I can check out for you let me know:

bunq-desktop-bug

Crecket commented 5 years ago

Ah found it, the IBAN number formatting function was the cause.

for (let i = 0, len = iban.length; i < len; i += 4) {
    ret.push(iban.substr(i, 4));
}

With SWIFT payments there is no counterparty IBAN number