Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FiftyOne.Pipeline.CloudRequestEngine" Version="4.5.23" />
<PackageReference Include="FiftyOne.Pipeline.CloudRequestEngine" Version="4.5.27" />
<PackageReference Include="System.Text.Json" Version="8.0.6" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion FiftyOne.DeviceDetection.Data/Data/IDeviceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* such notice(s) shall fulfill the requirements of that article.
* ********************************************************************* */
using FiftyOne.Pipeline.Core.Data.Types;
using FiftyOne.Pipeline.Core.Data;
using FiftyOne.Pipeline.Engines.Data;
using System.Collections.Generic;

Expand Down
1 change: 0 additions & 1 deletion FiftyOne.DeviceDetection.Data/DeviceDataBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* such notice(s) shall fulfill the requirements of that article.
* ********************************************************************* */
using FiftyOne.Pipeline.Core.Data.Types;
using FiftyOne.Pipeline.Core.Data;
using FiftyOne.Pipeline.Core.FlowElements;
using FiftyOne.Pipeline.Engines.Data;
using FiftyOne.Pipeline.Engines.FlowElements;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FiftyOne.Pipeline.Engines.FiftyOne" Version="4.5.24" />
<PackageReference Include="FiftyOne.Pipeline.Engines.FiftyOne" Version="4.5.29" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

using FiftyOne.DeviceDetection.Hash.Engine.OnPremise.Data;
using FiftyOne.Pipeline.Core.FlowElements;
using FiftyOne.Pipeline.Engines.Data;
using FiftyOne.Pipeline.Engines.FiftyOne.Data;
using FiftyOne.Pipeline.Engines.Services;
using Microsoft.Extensions.Logging;
Expand Down
23 changes: 16 additions & 7 deletions FiftyOne.DeviceDetection.PropertyKeyed/Data/MultiDeviceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
using FiftyOne.Pipeline.Core.FlowElements;
using FiftyOne.Pipeline.Engines.Data;
using FiftyOne.Pipeline.Engines.FlowElements;
using FiftyOne.Pipeline.Engines.FiftyOne.Data;
using FiftyOne.Pipeline.Engines.FiftyOne.FlowElements;
using FiftyOne.Pipeline.Engines.Services;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using FiftyOne.Pipeline.Core.Data;

namespace FiftyOne.DeviceDetection.PropertyKeyed.Data
{
Expand All @@ -49,8 +48,8 @@ public class MultiDeviceData :
private readonly List<uint> _profileIds = new List<uint>();
private readonly PropertyKeyedDataSet _dataSet;
private List<IDeviceData> _cachedProfiles;
private readonly List<Pipeline.Core.Data.IFlowData> _ownedFlowDatas =
new List<Pipeline.Core.Data.IFlowData>();
private readonly List<IFlowData> _ownedFlowDatas =
new List<IFlowData>();
private readonly object _lock = new object();
private bool _disposed;

Expand Down Expand Up @@ -79,8 +78,12 @@ public IReadOnlyList<IDeviceData> Profiles
/// <param name="logger">Logger instance.</param>
/// <param name="pipeline">The pipeline this data belongs to.</param>
/// <param name="engine">The engine that created this data.</param>
/// <param name="missingPropertyService">Service for handling missing properties.</param>
/// <param name="dataSet">The data set containing pipeline reference for profile resolution.</param>
/// <param name="missingPropertyService">
/// Service for handling missing properties.
/// </param>
/// <param name="dataSet">
/// The data set containing pipeline reference for profile resolution.
/// </param>
public MultiDeviceData(
ILogger<MultiDeviceData> logger,
IPipeline pipeline,
Expand All @@ -89,7 +92,8 @@ public MultiDeviceData(
PropertyKeyedDataSet dataSet)
: base(logger, pipeline, engine, missingPropertyService)
{
_dataSet = dataSet ?? throw new ArgumentNullException(nameof(dataSet));
_dataSet = dataSet ??
throw new ArgumentNullException(nameof(dataSet));
this[ProfilesKey] = new List<IDeviceData>();
}

Expand Down Expand Up @@ -125,7 +129,11 @@ private List<IDeviceData> ResolveProfiles()

foreach (var profileId in _profileIds)
{
// Using is not used as the disposal of flow data is managed by
// this class to ensure it remains available when values are
// retrieved.
var flowData = _dataSet.Pipeline.CreateFlowData();

flowData.AddEvidence(
Shared.Constants.EVIDENCE_PROFILE_IDS_KEY,
profileId.ToString());
Expand All @@ -135,6 +143,7 @@ private List<IDeviceData> ResolveProfiles()
if (deviceData != null)
{
result.Add(deviceData);

// Track for disposal
_ownedFlowDatas.Add(flowData);
}
Expand Down
57 changes: 57 additions & 0 deletions FiftyOne.DeviceDetection.PropertyKeyed/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* *********************************************************************
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
* Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
*
* This Original Work is licensed under the European Union Public Licence
* (EUPL) v.1.2 and is subject to its terms as set out below.
*
* If a copy of the EUPL was not distributed with this file, You can obtain
* one at https://opensource.org/licenses/EUPL-1.2.
*
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
* amended by the European Commission) shall be deemed incompatible for
* the purposes of the Work and the provisions of the compatibility
* clause in Article 5 of the EUPL shall not apply.
*
* If using the Work as, or as part of, a network application, by
* including the attribution notice(s) required under Article 5 of the EUPL
* in the end user terms of the application under an appropriate heading,
* such notice(s) shall fulfill the requirements of that article.
* ********************************************************************* */

using FiftyOne.DeviceDetection.Hash.Engine.OnPremise.FlowElements;
using FiftyOne.Pipeline.Core.Exceptions;
using FiftyOne.Pipeline.Core.FlowElements;

namespace FiftyOne.DeviceDetection.PropertyKeyed
{
public static class Extensions
{
/// <summary>
/// Returns the <see cref="DeviceDetectionHashEngine"/> if present in
/// the pipeline.
/// </summary>
/// <param name="pipeline"></param>
/// <returns>
/// The instance of <see cref="DeviceDetectionHashEngine"/> from the
/// pipeline.
/// </returns>
/// <exception cref="PipelineConfigurationException">
/// Thrown if there is no instance of
/// <see cref="DeviceDetectionHashEngine"/> available.
/// </exception>
public static DeviceDetectionHashEngine GetDeviceDetectionHashEngine(
this IPipeline pipeline)
{
var engine = pipeline.GetElement<DeviceDetectionHashEngine>();
if (engine == null)
{
throw new PipelineConfigurationException(
$"Ensure {nameof(DeviceDetectionHashEngine)} is added " +
$"to the pipeline");
}
return engine;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<ItemGroup>
<ProjectReference Include="..\FiftyOne.DeviceDetection.Hash.Engine.OnPremise\FiftyOne.DeviceDetection.Hash.Engine.OnPremise.csproj" />
<PackageReference Include="FiftyOne.Pipeline.Engines.FiftyOne" Version="4.5.24" />
<PackageReference Include="FiftyOne.Pipeline.Engines.FiftyOne" Version="4.5.29" />
</ItemGroup>

</Project>
Loading