restore_history does not clear cursor cache
I noticed that after restoring the history, the restored values are not
available on records that were already loaded in the transaction.
Basically, something like :
party = Party(name='John')
party.save()
party_id = party.id
party_create_date = party.create_date
Transaction().cursor.commit()
party = Party(party_id)
party.name = 'Snow'
party.save()
Transaction().cursor.commit()
party = Party(party_id)
party.name # Force loading of field 'name'
Party.restore_history([party_id], party_create_date)
party.name == 'John' # False
Party(party_id).name == 'John' # False, name is still in cache
# True : Forcing the search resets the cache
Party.search([('id', '=', party_id)])[0].name == 'John'
It could be a simple matter of clearing the cache at the end of restore_history
much like it is done at the end of "write" in ModelStorage, but maybe this
is by design ?