metaplex-foundation / js

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

Overriding inserted items on CMv3 does not work #476

Closed kevinfaveri closed 1 year ago

kevinfaveri commented 1 year ago

Thus, this guide is invalid: https://docs.metaplex.com/programs/candy-machine/inserting-items#overriding-existing-items

I also tested with setting the index and then trying to replace 5 items. It throws CandyMachineIsFullError

lorisleiva commented 1 year ago

Hi there, I'm not sure why that wouldn't work since we've got a test for it.

https://github.com/metaplex-foundation/js/blob/cc4b40afb9c9f7570d0b50f8c24c9ba2df4fecb9/packages/js/test/plugins/candyMachineModule/insertCandyMachineItems.test.ts#L214

Could you check your code with this test to make sure it's okay? Otherwise, I'll need more details to be able to reproduce and fix this.

kevinfaveri commented 1 year ago

Yep, that's what I expected as well. Here's what I did:

Monky patching the validation of "CandyMachineIsFullError" inside the "insertCandyMachineItems" (commenting it out) allows me to push this transaction, which correctly overwrites

Other details: using MacOS last version, using NextJS latest, using mainnet

lorisleiva commented 1 year ago

Thanks for raising this. I merged a fix and will be publishing a new version today.