-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guid fields do not send back an empty list when no matching guid exists #150
Comments
hey, @ITDancer13 any idea on when this might get resolved? |
just went to submit a PR for this and when I made tests for it I realized it was working! gave it a whirl in an API I have on v2.5.4 and it seems to be working now. not sure what version it got updated in, but I'll go ahead and close this out |
i tried filter Id==018BB311-7E80-8711-9D62-DCD5BD0B04B2 i'm using Version 2.5.4 |
@fority can you please provide a minimal sample which shows your issue. |
sorry is my bad. I forget to add mapper to property. it is working now |
reopening this. I AM still seeing this when i pass a non-guid to a filter, for example: |
FYI @ITDancer13 I made a repo for you to see it in action here. To repro:
I started working on a PR for this, but something like the below throws a compile error: [Fact]
public void Filtering_Guid_Field_By_String_Returns_Count_Zero()
{
var stringToUserForFilter = "something";
var comments = new List<Post>
{
new Post
{
ExternalId = Guid.NewGuid(),
Title = "title 1"
},
new Post
{
ExternalId = Guid.NewGuid(),
Title = "title 2"
},
}.AsQueryable();
var model = new SieveModel
{
Filters = $"ExternalId=={stringToUserForFilter}"
};
var result = _processor.Apply(model, comments);
Assert.Equal(0, result.Count());
} So I'm not sure what the difference is offhand. It did seem like the implementation that throws a bug uses an |
@ITDancer13 following up on your thoughts here. This is a pretty severe bug. |
@pdevito3 I'll take a look at it within the next days. |
Happy to help or provide more info, but not familiar enough with the workings of the codebase to properly dig in |
Describe the bug
When doing a filter like
GuidField == 08009a84-f343-b4c5-5577-a56a23588f9d
when the value exists works as expected and filters the list down to just that value, but when the value doesn't exist, it returns a full unfiltered list instead of an empty list like it usually would for a non-guid field.To Reproduce
Steps to reproduce the behavior:
id
)id == 08009a84-f343-b4c5-5577-a56a23588f9d
where the guid value does not exist in the datasetExpected behavior
I would expect an empty list
[]
to show up like we usually see with other data types, but we get a full unfiltered list of recordsScreenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: