[security] Call refresh tree when switching diff mode or user