transferOwnership via smart contract function might still have cache issue and doesn't update in API request
When calling a smart contract function to change NFT collection ownership it still wont update in the API request although transaction executes successfully. Im assuming its still a cache issue as we have no way of verifying.
SC function used -
#[endpoint(transferOwner)]
fn transfer_owner(&self, token_ident: TokenIdentifier) {
let new_owner = self.blockchain().get_caller();
self.send().esdt_system_sc_proxy().transfer_ownership(&token_ident, &new_owner.to_address()).async_call().call_and_exit();
}
Explorer Link: [https://devnet-explorer.elrond.com/transactions/9d6d614079f6835d9475c138b0594394b376f0f74e0c74345d3f2d9333c091c8]
hello!
indeed, we have a caching issue here. we cache the collection / token properties (including owner) for 24h for performance reasons, and right now we do not have any invalidation logic.
We could use the transaction processor to invalidate the owner, but TP only interprets transactions and omits smart contract results, as in the transaction depicted above.
A more robust mechanism would be to fetch logs, which we have as a short term plan anyway. Until then, we have the 24h caching issue
The issue has been fixed with the following PR: https://github.com/multiversx/mx-api-service/pull/912