Table in dymanic region not updating

Product: PowerShell Universal
Version: 4.0.10

Running these blocks to display/remove data from a SQLite DB.

New-UDDynamic -Id "dyn_ToDoTable" -Content {
    $getAllQuery = "select * from ToDoNameChange"
    $session:allChangesToDo = Invoke-SqliteQuery -DataSource $db -Query $getAllQuery

    New-UDTable -id "tbl_ToDoChanges" -Data $session:allChangesToDo -Columns $columns -ShowSelection
}

new-udbutton -id "btn_Remove" -Text "Remove Selected" -OnClick {
    $session:ToDoSelection = get-udelement -Id "tbl_ToDoChanges"
    foreach ($session:selection in $session:ToDoSelection.selectedrows){
        $removeQuery = "delete from todonamechange where Empid = '$($session:selection."EmpID")'"
        Invoke-SqliteQuery -DataSource $db -Query $removeQuery
        Show-UDToast -Message "removed"
    }
    $session:allChangesToDo = $null
    Sync-UDElement -Id "dyn_ToDoTable"
}

When I click the button the table never reloads and the toast never appears, but the data is removed from the DB so the onclick and foreach are definitely working. I don’t see any errors appear in the App log.

restarted the whole app and now the toast appears, but the table still doesn’t reload.

Ok. I added a loading component to it and now it refreshed properly.

Do dynamic regions require the loading component?

EDIT:

I just confirmed. The dymanic region on this page will not refresh unless I add the -loadingcomponent.

tbl_update

$db = "DB LOCATION"

$columns = @(
    New-UDTableColumn -Property EmpID -Title "Employee ID"
    New-UDTableColumn -Property FirstName -Title "First Name"
    New-UDTableColumn -Property middleName -Title "Middle Name"
    New-UDTableColumn -Property lastName -Title "Last Name"
    New-UDTableColumn -Property OlduserName -Title "Old Username"
    New-UDTableColumn -Property newuserName -Title "New Username"
    New-UDTableColumn -Property updateBP -Title "Update BP" -Render {
        if ($eventdata.updateBP -eq "0"){
            New-UDTypography -Text "False"
        }
        else{
            New-UDTypography -Text "True"
        }
    }
)

New-UDDynamic -Id "dyn_ToDoTable" -Content {
    $getAllQuery = "select * from ToDoNameChange"
    $session:allChangesToDo = Invoke-SqliteQuery -DataSource $db -Query $getAllQuery

    New-UDTable -id "tbl_ToDoChanges" -Data $session:allChangesToDo -Columns $columns -ShowSelection
} 
new-udhtml -Markup "</br>"
    new-udhtml -Markup "</br>"

New-UDDynamic -Id "dyn_ToDoTable2" -Content {
    $getAllQuery2 = "select * from ToDoNameChange"
    $session:allChangesToDo2 = Invoke-SqliteQuery -DataSource $db -Query $getAllQuery2

    New-UDTable -id "tbl_ToDoChanges2" -Data $session:allChangesToDo2 -Columns $columns -ShowSelection
} -LoadingComponent {
    New-UDProgress -Circular
}
new-udhtml -Markup "</br>"
    new-udhtml -Markup "</br>"

new-udbutton -id "btn_Remove" -Text "Remove Selected" -OnClick {
    $session:ToDoSelection = get-udelement -Id "tbl_ToDoChanges"
    foreach ($session:selection in $session:ToDoSelection.selectedrows){
        $removeQuery = "delete from todonamechange where Empid = '$($session:selection."EmpID")'"
        Invoke-SqliteQuery -DataSource $db -Query $removeQuery
        Show-UDToast -Message "removed"
    }
    $session:allChangesToDo = $null
    $session:allChangesToDo2 = $null
    Sync-UDElement -Id "dyn_ToDoTable"
    Sync-UDElement -Id "dyn_ToDoTable2"
}

This was fixed in 4.1. Please let me know if you still see the issue there.