dhojayev / traderepublic-portfolio-downloader

App that downloads transactions and PDF documents from Trade Republic depot
GNU General Public License v3.0
14 stars 0 forks source link

Do not exit with fatal error on unknown transactions #26

Closed dhojayev closed 3 months ago

dhojayev commented 3 months ago

In order to allow people with transactions that are yet not know by the app to be able to build the CSV and download PDF documents it is necessary to not exit but rather continue when a response with unknown transaction type is received.

It would be great to not fail and continue on the list and output the summary of the IDs of transactions that are yet unknown to the app. This will allow people to share that information and use the app with the transactions that are already known and supported.

tenjaa commented 3 months ago

I guess this is the issue I ran into? So if you need someone with an unsupported transaction to test somthing I would offer my account :)

Jun  5 21:27:33.866 [PANI] could not fetch transactions: could not unmarshal timelineTransactions response: json: cannot unmarshal object into Go struct field TransactionResponse.items.subAmount of type string
panic: (*logrus.Entry) 0xc0002b0a80

goroutine 1 [running]:
github.com/sirupsen/logrus.(*Entry).log(0xc0002b0150, 0x0, {0xc000338180, 0xb6})
        /go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:260 +0x491
github.com/sirupsen/logrus.(*Entry).Log(0xc0002b0150, 0x0, {0xc0000a5e60?, 0xc0001d1180?, 0xc0002a4ab0?})
        /go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:304 +0x48
github.com/sirupsen/logrus.(*Logger).Log(0xc0001d1180, 0x0, {0xc0000a5e60, 0x1, 0x1})
        /go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/logger.go:204 +0x58
github.com/sirupsen/logrus.(*Logger).Panic(...)
        /go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/logger.go:253
main.main()
        /github/workspace/cmd/portfoliodownloader/public/main.go:44 +0x43b
dhojayev commented 3 months ago

Hi @tenjaa, thanks for the log report you posted. Would be really helpful if you could post the responses both from the timeline and details. You can enable storing responses by passing -w when running the app. But please do not forget to falsify the IDs and document URLs for data protection. Thanks again.

dhojayev commented 3 months ago

@tenjaa actually just noticed that it is failing while fetching the timeline, so there are no details available yet at that stage. So please send me the JSON that is available with falsified ids and remove docs url.

dhojayev commented 3 months ago

@tenjaa let's continue here please: https://github.com/dhojayev/traderepublic-portfolio-downloader/issues/27

dhojayev commented 3 months ago

@dmagur please download the binary from here and let me know if it works now for you: https://github.com/dhojayev/traderepublic-portfolio-downloader/actions/runs/9408338061

dmagur commented 3 months ago

@dhojayev it works now!