There are a lot of questions online but the topic appears a bit confused.
Here says that "Keep in mind though, that this will return the transaction hash, and not the [returned] value itself. If you want the [returned] value, you need to get the function through a call", where a call, if I understand, is a local invocation of the transaction but the changes are discarded and the result is returned.
On Ethereum forum says that "Transactions cannot return results to web3.js. Note this! The [sendCoin] function returns a value but this cannot be checked in your test. This method is a transaction (i.e., something that modifies values or send ether), and the result of a transaction to web3.js is a transaction hash", so I cannot recover the value returned by the function without having an event, that implies that a malicious user can watch on that event type and read all content.
On Etherem StackExchange forum, the solution proposed are 1) Mutate the state via a transaction and then read the resulting state by calling a view
function that is useless for us since a function called later cannot read the data (the content is consumed) 2) Mutate the state via a transaction and emit an event
that's observed by the caller (that is the same solution proposed on Ethereum Forum but is very unsecure).
In same place that I don't find now, I've read that Remix performs a call (without changing the data) and then performs a transaction. The problem is that, potentially, this two invocation can be independent so a malicious user can simply delete the trasanction invocation, then retrieving all the content unlimited times.
So, we have to perform a call and then invoke on it the transaction even if the result is ready to be shown and bypass any security issuu?