Skip to content

Commit

Permalink
addresses an issue with polling
Browse files Browse the repository at this point in the history
- when multiple rcc used on the same page items fails to subscribe for polling if rcc rendered shadow control for a twinelement
  • Loading branch information
PTKu committed Aug 8, 2023
1 parent c4315dc commit 9214453
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ protected override void OnParametersSet()

private void SubscribeForPolling(IRenderableComponent component, ITwinElement element)
{
if (_pollingStarted) return;
if (this.Presentation.StartsWith("Shadow")) return;

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_BoolControlComponentWithBuilder_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_BoolControlComponentWithBuilder_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 305

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_BoolDisplayComponentWithBuilder_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_BoolDisplayComponentWithBuilder_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 321

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_ComponentWithinPipeline_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_ComponentWithinPipeline_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 350

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_ComponentWithinPipelineEmptyString_Unsuccessfull

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_ComponentWithinPipelineEmptyString_Unsuccessfull() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 377

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_ComponentWithinPipelineRandomString_Unsuccessfull

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_ComponentWithinPipelineRandomString_Unsuccessfull() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 365

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_DateTimeDisplayComponentWithBuilder_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_DateTimeDisplayComponentWithBuilder_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 336

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_GenericBaseControlComponentWithBuilder_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_GenericBaseControlComponentWithBuilder_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 392

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_GenericBaseControlWithinPipeline_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_GenericBaseControlWithinPipeline_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 420

Check failure on line 118 in src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/RenderableContent/RenderableContentControl.razor.cs

View workflow job for this annotation

GitHub Actions / Test report

AXSharp.RenderableContent.Tests.ComponentServiceTests ► Get_GenericBaseDisplayComponentWithBuilder_NotNullAreEqual

Failed test found in: TestResults/AXSharp.RenderableContent.Tests.csproj_net6.0.xml Error: System.NullReferenceException : Object reference not set to an instance of an object.
Raw output
System.NullReferenceException : Object reference not set to an instance of an object.
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.SubscribeForPolling(IRenderableComponent component, ITwinElement element) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 118
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.GetComponent(Type twinType, ITwinElement twin, String presentationName, String namespc) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 372
   at AXSharp.Presentation.Blazor.Controls.RenderableContent.RenderableContentControl.ViewLocatorBuilder(Type twinType, ITwinElement twin, String presentationType) in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\src\AXSharp.Presentation.Blazor.Controls\RenderableContent\RenderableContentControl.razor.cs:line 159
   at AXSharp.RenderableContent.Tests.ComponentServiceTests.Get_GenericBaseDisplayComponentWithBuilder_NotNullAreEqual() in C:\actions-runner\_work\axsharp\axsharp\src\AXSharp.blazor\tests\sandbox\AXSharp.RenderableContent.Tests\ComponentServiceTests.cs:line 406
if (component == null) return;
if(PolledComponents.Contains(component)) return;
PolledComponents?.Add(component);
component?.AddToPolling(element, this.PollingInterval);
_pollingStarted = true;
Expand All @@ -126,7 +127,7 @@ private void UnSubscribeFromPolling()
{
foreach (var renderableComponent in PolledComponents)
{
renderableComponent.RemovePolledElements();
renderableComponent?.RemovePolledElements();
}

_pollingStarted = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@page "/ShadowProperties"

<RenderableContentControl Presentation="ShadowControl"
Context="@Entry.Plc.all_primitives" />
Context="@Entry.Plc.all_primitives" />

<RenderableContentControl Presentation="Control"
Context="@Entry.Plc.all_primitives" PollingInterval="250" />



0 comments on commit 9214453

Please sign in to comment.