-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
bookmarkFinder.FindBookmarksAsync<Activity>(correlationId) returns all of that type #1604
Comments
Different but related issue. Before my fix, the in-memory provider was used for Bookmark storage but now the YesSQL one is used. Looks like you found a query that is not properly mapped. If you can show me the full stack trace I might see what code is setting up the OR specification. |
|
I can't seem to reproduce this issue from here. Can you send me a (stripped down) version of your project I can look at? |
Yep, creating one now while working on other bugs |
I didn't come across the above error ( However, this function isn't returning anything in the test project above.: It returns 0 (IEnumerable) records, if you can spot anything wrong with it? I tried a few combinations with no success |
The example above sets the workflow into action itself Producing new |
|
Its failed sql exec sp_executesql N'SELECT DISTINCT [Elsa2_Bookmarks_Document].* FROM [Elsa2_Bookmarks_Document] INNER JOIN [Elsa2_Bookmarks_BookmarkIndex] AS [BookmarkIndex_a1] ON [BookmarkIndex_a1].[DocumentId] = [Elsa2_Bookmarks_Document].[Id] WHERE ((([BookmarkIndex_a1].[TenantId] IS NULL) and ([BookmarkIndex_a1].[ActivityType] = @p0)) and (@p1 or ([BookmarkIndex_a1].[CorrelationId] = @p2)))',N'@p0 nvarchar(4000),@p1 bit,@p2 nvarchar(4000)',@p0=N'RunCodeActivity',@p1=0,@p2=N'Bookmarks-2021-10-06 08:15:35Z' Messages:
|
It seems to work correctly when I try:
Yes that would indeed be an issue. You should be able to add it manually. |
It would appear the following could be causing the bad SQL from
It would appear this part is evaluating With the exception:
Now to check the test project |
SQL and parameters were equal between both SqlLite and SqlServer on both my projects (test and master). We could create a better
|
Makes sense. Do you want to send a PR? |
Possibly, which direction would you prefer? Its been a while since I've used linqkit public override Expression<Func<Bookmark, bool>> ToExpression() =>
CorrelationId == null
? bookmark => bookmark.TenantId == TenantId
&& bookmark.ActivityType == ActivityType
: bookmark => bookmark.TenantId == TenantId
&& bookmark.ActivityType == ActivityType
&& bookmark.CorrelationId == CorrelationId; public Expression<Func<Bookmark, bool>> ToExpression() {
LinqKit.ExpressionStarter<Bookmark>? expressionBuilder = LinqKit.PredicateBuilder.New<Bookmark>();
expressionBuilder = expressionBuilder.And(bookmark => bookmark.TenantId == TenantId);
expressionBuilder = expressionBuilder.And(bookmark => bookmark.ActivityType == ActivityType);
if (this.CorrelationId != null)
{
expressionBuilder = expressionBuilder.And(bookmark => bookmark.CorrelationId == CorrelationId);
}
return expressionBuilder;
} |
Let's stick with your first suggestion - seems simpler if you agree? |
It was certainly the quickest to write but not as much fun as playing with linqkit |
Well I certainly wouldn’t want to bereft you of your fun :D Feel free to use linqkit - it may prove useful in other areas as well. |
Finding bookmarks by correlation id doesn't seem to filter by correlation id;
correlationId : Bookmarks-2021-10-05 15:48:34Z
The two records above being two different correlations roughly ~2 mins from each other where I should only be expecting the latter.
Speaking of bookmarks...
They never seem to go into the yessql store. Is there an option to persist them that I've missed?
And they all disappear when the app restarts
The text was updated successfully, but these errors were encountered: