The bug
If a villager decides to discount its trades while trading due to increased player reputation or the hero of the village effect, the discounts are not available right away until the menu is closed and reopened. After the fix of MC-310787, players are more likely to keep the trading window open for longer, and so may miss out on discounts that they are entitled to.
How to reproduce
Spawn a villager
Get lots of emeralds
Trade with it for a while without closing the menu
Close the menu and reopen it
Expected results
The discounts should have appeared while you were trading
Observed results
They didn’t appear until you closed and reopened the menu
Notes
Another way to reproduce this is to give yourself the hero of the village effect with a delayed command block.
As @clamlol pointed out, villagers can restock while trading, and the trades and prices do update in that case without needing to close and reopen the window.
Linked issues
relates to 1
Attachments
Comments 3
Can also confirm. For testing with Hero of the Village, the following command may be helpful: /give @s minecraft:splash_potion[minecraft:potion_contents={custom_color:9502593,custom_effects:[{id:"hero_of_the_village",amplifier:0b,duration:2000}]},minecraft:custom_name={text:"Potion of Heroism",italic:0b}]
Can confirm.