Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ protected virtual void FetchProperty(string propertyName)
return; // throw?
}

var updateProperty = true;
switch (propertyName)
{
case nameof(Name):
Expand All @@ -198,9 +199,21 @@ protected virtual void FetchProperty(string propertyName)
case nameof(Icon):
this.Icon = new(model.Icon);
break;
default:
updateProperty = false;
break;
}

UpdateProperty(propertyName);
// GH #38829: If we always UpdateProperty here, then there's a possible
// race condition, where we raise the PropertyChanged(SearchText)
// before the subclass actually retrieves the new SearchText from the
// model. In that race situation, if the UI thread handles the
// PropertyChanged before ListViewModel fetches the SearchText, it'll
// think that the old search text is the _new_ value.
if (updateProperty)
{
UpdateProperty(propertyName);
}
}

public new void ShowException(Exception ex, string? extensionHint = null)
Expand Down
Loading