Skip to content

Commit

Permalink
fix bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
thelonelyvulpes committed Aug 31, 2022
1 parent 5d787cd commit 33f47a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Neo4j.Driver/Neo4j.Driver/Internal/AsyncSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ private async Task AcquireConnectionAndDbNameAsync(AccessMode mode)
{
if (_useBookmarkManager)
_bookmarks = _bookmarks == null
? Bookmarks.From(_bookmarkManager.GetAllBookmarks())
? Bookmarks.From(_bookmarkManager.GetBookmarks("system"))
: Bookmarks.From(_bookmarkManager.GetAllBookmarks().Concat(_bookmarks?.Values));


_connection = await _connectionProvider.AcquireAsync(mode, _database, ImpersonatedUser(), _bookmarks)
.ConfigureAwait(false);

Expand Down
5 changes: 2 additions & 3 deletions Neo4j.Driver/Neo4j.Driver/Internal/DefaultBookmarkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Neo4j.Driver.Internal;
internal class DefaultBookmarkManager : IBookmarkManager
{
private Dictionary<string, HashSet<string>> _bookmarkSets;
private readonly Func<string, string[]> _bookmarkSupplier;
private readonly Func<string?, string[]> _bookmarkSupplier;
private readonly Action<string, string[]> _onBookmarks;
private readonly SemaphoreSlim _lock;

Expand Down Expand Up @@ -107,8 +107,7 @@ public string[] GetAllBookmarks()
if (_bookmarkSupplier == null)
return set.ToArray();

foreach (var key in keys)
set.UnionWith(_bookmarkSupplier(key));
set.UnionWith(_bookmarkSupplier(null));

return set.ToArray();
}
Expand Down

0 comments on commit 33f47a4

Please sign in to comment.