CirclesUBI / circles-myxogastria

Webapp and mobile client for Circles
https://circles.garden
GNU Affero General Public License v3.0
37 stars 21 forks source link

Optimizing api calls for payment notes in wallet statement export #663

Closed louilinn closed 1 year ago

louilinn commented 1 year ago

coded with @juanenrisley :star2: thanks for the help!

netlify[bot] commented 1 year ago

Deploy Preview for preview-review-circles-garden ready!

Name Link
Latest commit 3eca29b3a2332b8fc812c99f2f402b4f484dd789
Latest deploy log https://app.netlify.com/sites/preview-review-circles-garden/deploys/644a80389e4603000806033a
Deploy Preview https://deploy-preview-663.review.circles.garden/
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 settings.

mikozet commented 1 year ago

It behaves a bit strange for me at the beginning. First export is always longer and includes some errors... It doesn't happend for the second time... Screenshot from 2023-04-26 09-12-46

louilinn commented 1 year ago

It behaves a bit strange for me at the beginning.

First export is always longer and includes some errors...

It doesn't happend for the second time...

It takes longer because each payment note is requested in sequence rather than all at once. This is to prevent overloading the api.

The number of errors are identical to before (for same wallet and same period). The api responds with 404 when the tx hash doesnt exist in the db, which it doesnt when payment note is enpty / non existent. I will file an issue in api to change this behaviour and also to request many payment notes at once.

You can see the same 404 error if you go to avtivity log and open a transfer that doesn't have a payment note.

mikozet commented 1 year ago

It takes longer because each payment note is requested in sequence rather than all at once. This is to prevent overloading the api.

The number of errors are identical to before (for same wallet and same period). The api responds with 404 when the tx hash doesnt exist in the db, which it doesnt when payment note is enpty / non existent. I will file an issue in api to change this behaviour and also to request many payment notes at once.

You can see the same 404 error if you go to avtivity log and open a transfer that doesn't have a payment note.

but did you notice that at first time of export there are errors and it takes longer to load and when you do export second time there are no errors and it is faster (without changing date range)

mikozet commented 1 year ago

note from meeting: it's probably because it is cached