metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

How to recover arweave links generated on failure of metaplex.storage().uploadAll(metaplexFilles)? #256

Closed HereFrank closed 1 year ago

HereFrank commented 2 years ago

These is the case, supposed that I want to generate 10.000 arweave links and I make a code like these: const imageLinks = await metaplex.storage().uploadAll(metaplexFiles) being metaplexFile an array of metaplex files with images that I want to convert to arweave links... Seeing the code here: https://github.com/metaplex-foundation/js/blob/1827aaea479106a966ba026fbc97fe4a78c240c3/packages/js/src/plugins/bundlrStorage/BundlrStorageDriver.ts#L105 I wonder:

In these case, due that the code are using a PromiseAll I think that the transaction will fail, but even that happen the user will be charge for the 5000 arweave links, and I think that I'm unable to get that arweave links, since the code is using PromiseAll behind the scenes. I think these a issue right? I mean, const imageLinks = await metaplex.storage().uploadAll(metaplexFiles) should provide some type of error handling to maybe obtain the 5000 arweave links generated in my example, right? And maybe a way to handle the concurrency of promises....

lorisleiva commented 2 years ago

Hi there 👋

That's correct, currently, the bulk upload mechanism is fairly rudimentary and could do with a better error and retry logic.

There's too much to do on this SDK for us to focus on this right now but it is something I'd like the SDK to support at some point.

In the meantime, I suggest working with the upload method and implement your own custom error handling.

Thanks for raising this.

lorisleiva commented 1 year ago

I'm going to mark this as a "feature request" since we're now logging these using Canny.io so people can upvote and comment on their favourite feature requests. Thanks for understanding. 🌸

github-actions[bot] commented 1 year ago

Hi @HereFrank,

Thank you for raising this!

We'd like to make sure our GitHub issue tracker remains the best place to manage issues that affect the development of the Metaplex JS SDK itself. It looks like your issue is suggesting an improvement rather than raising a bug.

Unless there exists evidence that this is a bug with the JS SDK itself, please use our Feature Request boards to create new posts or upvote existing ones. You may use the following links to access the JS SDK Feature Request board:

https://metaplex.canny.io/developers?category=js-sdk-tools

If you could please share the link to the relevant Feature Request here afterwards, that would be very helpful for anyone following this thread.


This automated message is a result of having added the "feature request" label.