Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: A second operation was started in DataGrid with EF Core #801

Closed
davidkudera opened this issue Sep 28, 2023 · 13 comments
Closed

fix: A second operation was started in DataGrid with EF Core #801

davidkudera opened this issue Sep 28, 2023 · 13 comments

Comments

@davidkudera
Copy link

馃悰 Bug Report

DataGrid with Paginator in version 3.1.0 and 3.1.1 fails with the following error:

A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext.

Sometimes it loads the first time after starting the app but fails on the next request.

馃捇 Repro or Code Sample

builder.Services.AddFluentUIComponents(options =>
{
    options.HostingModel = BlazorHostingModel.Server;
});

builder.Services.AddDataGridEntityFrameworkAdapter();
<FluentDataGrid Items="@_files" Pagination="_pagination" TGridItem="@File">
    <PropertyColumn Title="Name" Property="@((File f) => f.Name)" Sortable="true" IsDefaultSortColumn="true" InitialSortDirection="SortDirection.Ascending" />
</FluentDataGrid>

<FluentPaginator State="@_pagination" />

@code {

    private readonly PaginationState _pagination = new() { ItemsPerPage = 20 };

    private ApplicationContext? _context;

    private DbSet<File>? _files;

    public void Dispose()
    {
        _context?.Dispose();
    }

    protected override async Task OnInitializedAsync()
    {
        _context = await ContextFactory.CreateDbContextAsync();
        _files = _context.Files;
    }

}

馃 Expected Behavior

Not to fail.

馃槸 Current Behavior

info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
info: 28.09.2023 11:19:01.627 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
fail: Microsoft.EntityFrameworkCore.Query[10100]
      An exception occurred while iterating over the results of a query for context type 'ApplicationContext'.
      System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
      System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
fail: 28.09.2023 11:19:01.630 CoreEventId.QueryIterationFailed[10100] (Microsoft.EntityFrameworkCore.Query)
      An exception occurred while iterating over the results of a query for context type 'ApplicationContext'.
      System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
      System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
         at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Boolean& found)
         at lambda_method1928(Closure, QueryContext)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
         at Microsoft.Fast.Components.FluentUI.FluentDataGrid`1.<BuildRenderTree>b__113_1(RenderTreeBuilder __builder3) in /_/src/Core/Components/DataGrid/FluentDataGrid.razor:line 32
         at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
         at Microsoft.Fast.Components.FluentUI.DataGrid.Infrastructure.Defer.BuildRenderTree(RenderTreeBuilder builder) in /_/src/Core/Components/DataGrid/Infrastructure/Defer.cs:line 26
         at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit '1LCf-dBwf8NBgLlwQAp6gSqC2UtUGsOCS6o62lEQi3c'.
      System.InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads concurrently using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913.
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.ConcurrencyDetector.EnterCriticalSection()
         at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
         at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Boolean& found)
         at lambda_method1928(Closure, QueryContext)
         at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
         at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
         at Microsoft.Fast.Components.FluentUI.FluentDataGrid`1.<BuildRenderTree>b__113_1(RenderTreeBuilder __builder3) in /_/src/Core/Components/DataGrid/FluentDataGrid.razor:line 32
         at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
         at Microsoft.Fast.Components.FluentUI.DataGrid.Infrastructure.Defer.BuildRenderTree(RenderTreeBuilder builder) in /_/src/Core/Components/DataGrid/Infrastructure/Defer.cs:line 26
         at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
info: 28.09.2023 11:19:01.639 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (2ms) [Parameters=[@__p_1='20', @__p_0='0'], CommandType='Text', CommandTimeout='30']
      SELECT f.id, f.container_name, f.created_at, f.mime, f.name, f.resolution_v2, f.size
      FROM public.file AS f
      ORDER BY f.name
      LIMIT @__p_1 OFFSET @__p_0
info: 28.09.2023 11:19:01.647 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
      Executed DbCommand (2ms) [Parameters=[@__p_1='20', @__p_0='0'], CommandType='Text', CommandTimeout='30']
      SELECT f.id, f.container_name, f.created_at, f.mime, f.name, f.resolution_v2, f.size
      FROM public.file AS f
      ORDER BY f.name
      LIMIT @__p_1 OFFSET @__p_0
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
info: 28.09.2023 11:19:01.674 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f
info: 28.09.2023 11:19:01.706 RelationalEventId.CommandExecuted[20101] (Microsoft.EntityFrameworkCore.Database.Command)
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT count(*)::int
      FROM public.file AS f

馃拋 Possible Solution

Downgrade to version 3.0.1

馃敠 Context

Print a simple DataGrid with data from DbSet.

馃實 Your Environment

  • OS & Device: Windows 11
  • Browser: Brave, Chromium 117
  • .NET: 7.0.201
  • Blazor mode: server
  • Microsoft.Fast.Components.FluentUI: 3.1.1
  • Microsoft.Fast.Components.FluentUI.DataGrid.EntityFrameworkAdapter: 3.0.0
  • EF Core with PostgreSQL: 7.0.10
  • Npgsql: 7.0.4
@joecuevasjr
Copy link

I'm using v3.1.0 with no issue utilizing pagination. However, I do not set my context in OnInitializedAsync().
Since it's recommended to have a context per operation - Blazor with EF Core - Database Access, consider the following approach:

// Update _context field and remove relevant code from OnInitializedAsync()
private ApplicationContext? _context => ContextFactory.CreateDbContext();

@davidkudera
Copy link
Author

@joecuevasjr thanks for your comment, but I'm creating a context per operation (asynchronously): _context = await ContextFactory.CreateDbContextAsync();. I store it in a field so I can dispose it later.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Sep 30, 2023

I have very little experience with EF Core. The code for the adapter is almost a one one one copy of what is used with QuickGrid. Would be interesting to see if QuickGrid showed the same behavior

@joecuevasjr
Copy link

@davidkudera when the OnInitializedAsync method is called it's only once per component lifetime. It won't rerun for every operation in the component. The call to CreateDbContextAsync() is currently set up as a one time setup when it should be per operation, such as when the data is fetched for the datgrid.

@malcolmvs
Copy link

malcolmvs commented Oct 4, 2023

We're having the same issue. Downgrading from v3.1.1 to v3.0.1 appears to resolve this still has the issue intermittently but once I refresh it's workable until it fails again.
We setup our DB context as follows (understood this is scoped by default and is therefore problematic):

services.AddDbContext<OurDbContext>(options => options.UseSqlServer(connectionString));

And then make use of wrapper classes to expose the entities to the page:

IQueryable<Customer> customers = Enumerable.Empty<Customer>().AsQueryable();

    protected override async Task OnInitializedAsync()
    {
        customers = CustomerService.List();
    }

Where List() returns the DB set.

  • .NET: 6.0
  • Blazor mode: server
  • Microsoft.Fast.Components.FluentUI: 3.1.1
  • Microsoft.Fast.Components.FluentUI.DataGrid.EntityFrameworkAdapter: 3.0.0
  • EF Core with SQL Server: 7.0.10

@joecuevasjr
Copy link

The QuickGrid documentation on using EF-Core IQueryable shows the following code example as the simplest and most performant option for EF Core:

@inject ApplicationDbContext MyDbContext

<QuickGrid Items="@MyDbContext.People">
    ...
</QuickGrid>

@malcolmvs
Copy link

The QuickGrid documentation on using EF-Core IQueryable shows the following code example as the simplest and most performant option for EF Core:

@inject ApplicationDbContext MyDbContext

<QuickGrid Items="@MyDbContext.People">
    ...
</QuickGrid>

Thanks @joecuevasjr - do you know when MyDbContext will be disposed of in that implementation?

@malcolmvs
Copy link

@joecuevasjr correct me if I'm wrong, but calling Items.Count without making use of the asyncQueryExecutor is going to be causing this issue:

int totalItemCount = _asyncQueryExecutor is null ? Items.Count() : await _asyncQueryExecutor.CountAsync(Items);

v3.0.1 does not have the empty check which v3.1.1 does, in which Item.Count is being called - might explain why v3.0.1 works for the most part?

https://github.com/microsoft/fluentui-blazor/blob/v3.0.1/src/Core/Components/DataGrid/FluentDataGrid.razor

@if (Items?.Count() == 0 || _ariaBodyRowCount == 0)

@vnbaaij
Copy link
Collaborator

vnbaaij commented Oct 4, 2023

@malcolmvs I don't understand. How can I use the asyncQueryExecutor in line 411 if it is null?

v3.0.1 indeed does not have the empty check because that version did not have the EmptyContent parameter yet. It was added in 3.1.
De we just need to use totalItemCount in the empty check (by turning it in to a privale variable in the class)?

@malcolmvs
Copy link

Apologies @vnbaaij I see my comment is unclear. What I was trying to say is that by looking at the code I can see that asyncQueryExecutor needs to be used any time a count of the items is needed (IF the asyncQueryExecutor has been set). Thus the following code will cause an issue as it doesn't take the asyncQueryExecutor into consideration:

@if (Items?.Count() == 0 || _ariaBodyRowCount == 0)

I do believe you could use totalItemCount after exposing it but feel I don't understand the code well enough to be able to comment on a solution.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Oct 6, 2023

I think I can fix this by removing the Items?.Count() == 0 part from the line mentioned and just use the _ariaBodyRowCount part.
To make sure the _ariaBodyRowCount is set, I set it immediately after

int totalItemCount = _asyncQueryExecutor is null ? Items.Count() : await _asyncQueryExecutor.CountAsync(Items);

with _ariaBodyRowCount = totalItemCount;.

Sounds good?

@vnbaaij vnbaaij closed this as completed in 497ee86 Oct 6, 2023
vnbaaij added a commit that referenced this issue Oct 9, 2023
* Add UnitTests markdown page (#658)

* ProgressToast related cahnges (#657)

* FluentProgress: Add ValueChanged
FluentProgressRing: Add ValueChanged
Fix #655 and update example

* Do not use @Bind for FluentProgress Value
Update example

* Add colocated files to demos

* Undo add ValueChanged EventCallBack

* Add Width and Height property and associated styles (#663)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Point to unit test documentation

* re-add fixed to DemoSection tabs

* #624 Change NavMneu to use Icon Value
Update version in banner

* Update version in props

* Fix Icons and Emojis trimmed during the WASM publishing process (#666)

* FluentMessageBox: enable not supplying an icon to the body

* Add doc about Icons / Emojis (#673)

* Fix click not working on FluentTreeItem text (#667)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Fix the Tooltip used by the FluentOverflow (#678)

* Revert change in including web-components script. fix #668
Update Icon example

* Fix TextField AutoComplete property to a string property (#682)

* Fix #674 (#676)

* Fix DemoSection label sometimes wrong

* Fix #621 - Add aria-hidden to clear-button (#683)

Fix some search sample a11y issues

* Make FLuentToastContainer work better on mobile devices (was #684)

* Replace the Icons.AllIcons property with a GetAllIcons method using reflection (#685)

* Users/vnbaaij/update templates (#688)

* Update templates t0 use v3 package

* More template updates
Temp add global.json to pin 8.0.0-preview.7

* Set icon for EF Adapter package

* Fix EF Adapter Icon path

* Apply the oninput attribute to "text" components (#696)

* Add missing usings Project template (#702)

Fixes #701

* Fix templates missing using (beacause of Code CLeanup runningon save...)

* Remove PackageVersion from csproj to let it be set y pipeline

* Add item reference to FluentDataGridRow and FluentDataGridCell (#695) (#700)

Co-authored-by: Alessio Dell鈥橝quila <aquila@hks-systeme.de>

* [fix] multiline-text word-break (#711)

* [fix] multiline-text word-break

* test

* Add FluentDialogHeader, FluentDialogFooter and related updates (#717)

* Update build-core-lib.yml

* Add MessageBar component (#718)

* Add MessageBar 
* Demo site optimizations
* Add generic ActionLink and ActionButton classes
* Tune display of ApiDocumentation on smaller screens

* Users/dvoituron/autocomplete (#720)

* Draft version of Autocomplete component

* Autocomplete with basic features

* Update some UI details

* Add ArrowUp/ArrowDown to select items

* Add TemplateOption

* Add Demo styles

* Add Header and Footer content

* Add FluentOptionPeople component

* Finalize unsing People Component

* Add some aria attributes (not completed)

* Add face picture samples

* Revert ToC panel

* Add first tests

* Fix Unit Test

* Fix Unit Test

* Add Unit Tests

* Fix the complexity

* Add Unit Tests for FluentOptionPeople component

* FluentDataGridRow: sticky header z-index. Fix #721

* Use latest .NET SDKs
Fix null dereference warning
Remove global.json

* Fix issue with combined normal/timed MessageBars

* Put notification/settings icons in a button

* Update the DatePicker popup position (#724)

* [FluentAutocomplete] Update some usabilities (#725)

* Add MaximumSelectedOptionsMessage, a Search icon and a Dismiss icon

* Update Unit Tests

* Fix FluentDatePicker and FluentTimePicker to keep existing date/time values (#726)

* FluentMenuButton: Add ButtonStyle and MenuStyle parameters

* Couple of enhancements (#727)

* Fix issue with combined normal/timed MessageBars

* Put notification/settings icons in a button

* FluentMenuButton: Add ButtonStyle and MenuStyle parameters

* Add ChildContent (#728)

* Fix MessageOption Timeout xml documentation

* Update CodeSetup.md (#730)

Fix a typo

* [FluentMenu/FluentPopover/FluentOverlay] Close menu/popover automatically when user clicks outside of it (by using overlay) (#729)

* Fix FluentMenu / FluentOverlay to dismiss menu when clicked outside

* Fix FluentPopover/FluentOverlay

* Apply naming conventions

* Add `EmptyContent` parameter to the DataGrid (#731)

* Fix MessageOption Timeout xml documentation

* Add a EmptyContent parameter to FluentDataGrid

* [FluentPresenceBadge  & FluentOptionPeople] - Update the Status badge to be compliant FluentUI 2 (#732)

* Fix people ChildContent

* Update the FluentPresenceBadge

* Update the FluentOptionPeople

* Fix Unit Tests

* Fix Unit Tests

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Add more colors to OfficeColor enum

* Add a comment on FluentTabPage on styling indicator

* [CssBuilder and StyleBuilder] Fixing the built format and position of the custom styles (#745)

* Refactor StyleBuilder and add Unit Tests

* Update CssBuilder and StyleBuilder

* Update the CSS and Style Builder to include custom user styles at the end

* Update all existing classes

* Fix Unit Tests

* Add comment to ComboboxPage
Update some xml doc comments

* Update FluentDataGridRow and example (#747)

* Add a column with buttons to virtualized grid example with sticky header
Update FluentDataGridRow to align center when row height is set
Update FluentDataGrid to remove code that was already done in row rendering

* Process review remark

* fix typos (#751)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Update the Button.Loading when using with a Icon (#752)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Dialog enhancements (add dialog type, fix panel width setable), add MaxHeight to DemoSection (#740)

* Add Dialog custom header/footer example
Address #739
Change ShowDialog to allow horizontal alignment setting

* Add DialogType enum and set this in dialog parameters
Use  width parameter in panel example

* Fix review comments
Add MaxHeight to DemoSection

* REmove files no longer needed

* Cleanup for new alternative

* Make DialogType internal

* Revert "Make DialogType internal"

This reverts commit e80e451.

* Remove more HeaderTemplate/FooterTemplate references

* Fix NavMenu route/subroute not selecting correct item (#755)

* Fix NavMenu route/subroute not selecting correct item

* Fix compilation error

* Add extra "/" (if needed) to do a clean comparisson on segments

* [FluentDialog] Include components to customize the Dialog-box (#764)

* Update Fluent UI System  Icons to 1.1.217 (#765)

Move AllIcons property
Comment out Icons.cs creation in generator

* Add PreventScroll to Dialog and Overlay (#758)

* Add PreventScroll to Dialog and Overlay

* Move scroll restauration to DisposeAsync

* Change it to use a CSS only approach

* Fix manual dialog with PreventScroll

* Rename FluentOptionPeople to FluentPersona (#766)

* Rename FluentOptionPeople to FluentPersona

* Update tests

* Update version
Test for #771
Fix #772

* Fix #772 (for real this time...)

* Typo 'the the' (#773)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Add InlineStyleBuilder and fix the FluentSelect.Height property (#774)

* [FluentIcon] Use of Value attribute (not Icon) (#784)

* [WIP] Inert modal overlay (#783)

* Fix #772

* add InertModalOverlay to DialogParameters

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Rename InertModalOverlay to PreventDismissOnOverlayClick
Fix code comment
Clean up demo description
Extend sample with custom dialog to usee new parameter

* Fix NavMenu redirecting tosmae page when route parameters present (#755)
Fix obsolete warning for Notification Center

* Fix obsolete warnings
Update Whatsew, add What's New Archive

* Re-work padding/height for dialog variants (#786)

* Re-work padding/heigt for dialog variants

* Resolve review comments

* Fix more Obsolete warnings
Fix one more issue related to #755

* Add a Tooltip parameter to DataGrid columns  (#791)

* Add Tooltip parameter to DataGrid columns
Clean-up WhatsNew

* More tooltip work
Add Style parameter to ColumnBase
ApiDocumentation: InstanceType renamed to InstanceTypes and is array now

* Fix #789

* Button and Icon colors (#793)

* Add Icon.WithColor and update the Demo page

* Update Button Icon Color depending of Button Appearance

* Update the way to apply the Icon.Color in a Button

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* fix: enhanced DialogService doc with asp.net core 8 with ssr (#795)

* Update Fluent UI System Icons to 1.1.218
Add What's New file to Icons

* Remove generated Icons.cs file

* Update version for preview site footer

* Fix the Icon Color doc page (#796)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Fix MessageBar issues (#797)

* Implement MessageService OnMessageItemsUpdatedAsync handler
Rename OnAlertUpdateHandler to OnMessageItemsUpdatedHandler

* Make Title and Link nullable and don't render them when they are null
Adapt sample to show this situation

* Process review remarks

* Fix #805: InlineStyleBuilder on .NET6 (#806)

* corrects minor typo (#804)

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Several changes and fixes (#802)

* Fix #800 by doing more checks.
Tooltip example uses DemoLogger now
Tooltip: add delegate check
TemplateColumn: Add TooltipText parameter

* Add TooltipText to PropertyColumn + refactor
Extend DataGrid example to show tooltip usage
Fix comment issue
Fix MessageBar test

* Fix Server site  Flash of Unstyled Content
Add soem code to IssueTester to test navigation menu issues

* Change ColumBase button aria-label

* Add route parameters test to lab page

* NavMenu: Add ReNvigate parameter

* Change when ReNavigate gets passed

* Better ReNavigate implementation
Also added remark on commented code

* Fixes SimpleCustomizedDialog.razor (#807)

* corrects minor typo

* fixes typo in comments

* fix by restoring SimpleCustomizedDialog.razor

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Fix FluentDataGrid error if page is quickly exited (#810)

* [FluentInputFile] Fix the manual upload on iOS (#815)

* Update the manual upload on iOS

* Keep ShowFilesDialogAsync

* fixes minor typo (#824)

* Fix README.md minor typo (#827)

* Update README.md - typo (#829)

Fix a typo

* FluentSelect: Fix ValueChanged fired twice  (#828)

* FluentSelect: Fix ValueChanged fired twice
* Override Person.ToString() to not return image data
* Process review remarks

* 1)  Fix error in RenderDefaultHeaderContent related to recent tooltip work
2) Udo country code rename

* Fix #801 by removing  direct call to Items.Count() (#831)

* FluentCard: Add AreaRestricted parameter (#830)

* FluentCard: Add AreaRestricted parameter, update docs, tests and examples

* Update build-demo.yml

* Update build-demo.yml

* Update build-demo.yml

* Update build-demo.yml

* Error message updated when FluentDialogProvider is missing (#832)

* New NavMenu, NavGroup and NavLink components (#819)

* new FluentNavMenu, FluentNavGroup and FluentNavLink component

* Rename earlier FluentNavMenu to FluentNavMenuTree

* Update documentation, copy examples and add upgrade guide

* Fix #816

* Fix #811

* Add NavMenu components tests

* CounterBadge tests

* [Input Label] FluentInputLabel Add a Label and update aria-label (#822)

* Add a new FluentInputLabel component to display a label and to update the aria-label of the associated Input component

* Update for List components

* Update all Input samples

* Add a property LabelTemplate

* Rename Title property to AriaLabel

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* fix: chinese abbreviated day name in FluentCalendar (#834)

* [fix] chinese day abbreviated name

* [fix] add ToAbbreviatedDisplay summary

* [fix] revert to string

* [fix] use ShortestDayNames instead of AbbreviatedDayNames

* [fix] rename variable

* [fix] rename, add Abbreviated to tuple

* [fix] remove empty line

* [fix] remove empty line

---------

Co-authored-by: Vincent Baaij <vnbaaij@outlook.com>

* Minor documentation corrections (#837)

* corrects comment

* Reworded to improve clarity

* Corrects comments - removes /

* Fix #836

* Prepare for release - update whatsnew docs

* More whatsnew updates

---------

Co-authored-by: Denis Voituron <dvoituron@outlook.com>
Co-authored-by: Emanuele Curati <ema@outlook.com>
Co-authored-by: Antoine Griffard <agriffard@hotmail.com>
Co-authored-by: hksalessio <143792830+hksalessio@users.noreply.github.com>
Co-authored-by: Alessio Dell鈥橝quila <aquila@hks-systeme.de>
Co-authored-by: ssccinng <whs11998@163.com>
Co-authored-by: Yue Cui <37979368+LuohuaRain@users.noreply.github.com>
Co-authored-by: Gary Chan <gary.chan@c0g1t8.com>
Co-authored-by: James Newton-King <james@newtonking.com>
Co-authored-by: Alexis Narvaez <anarvaez@fullstacklabs.co>
Co-authored-by: Harry Pfleger <harry@ardimedia.com>
@vukasinpetrovic
Copy link

@vnbaaij I have the same problem but in my case it is happening if I double click on sorting the column, meaning it executes two operations fast. I'm using basic implementation for testing, without paging or anything additional. Do you have an idea how can I prevent this?

@inject ApplicationDbContext DbContext

<FluentDataGrid Items="@DbContext.Users">
    <PropertyColumn Property="@(u => u.Email)" Sortable="true" Align="Align.Start" />    
    <PropertyColumn Property="@(u => u.UserName)" Sortable="true" Align="Align.Start" />    
</FluentDataGrid>

@davidalexandru11
Copy link

I have similar problem with my QuickGrid component...

When use pagination="true" the request is twice, otherwise the request is single.

My problem is that if I click on a button that for example opens a modal, itemprovider its fired, but if i click to sort one column and then try to press the button again, itemsprovide is not fired.

So everytime I must to sort something , search something or change page inside the quickgrid componet to avoid that itemsproviders to fire

I tried different methods to avoid this but without success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants