Feature/web api updates#1433
Open
equinoy wants to merge 19 commits into
Open
Conversation
…mproved event handling
…for VLAN and PoE changes
…se for missing device
…puts, enhance logging for route mapping
The cache wasn't being cleared correctly, and was an unnecessary add.
…essionRequestHandler
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds standardized device interface contracts for wireless sharing and network switch port management, and refactors core routing plus a small Web API behavior/serialization tweak to improve consistency and reduce legacy payload noise.
Changes:
- Added new device contracts:
IHasWirelessSharing(+ event args) and network switch VLAN/PoE manager interfaces (+ event args/enum). - Simplified routing discovery by removing the “impossible routes” cache and refining route-mapping device filtering/logging.
- Updated MobileControl/AppServer JSON serialization to ignore nulls and adjusted the feedbacks Web API handler to return
200 OKwith empty arrays when a device key isn’t found.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DeviceStateMessageBase.cs | Marks legacy Interfaces payload obsolete and avoids emitting it when null. |
| src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DeviceMessageBase.cs | Ignores nulls for common device-message JSON fields. |
| src/PepperDash.Essentials.Core/Web/RequestHandlers/GetFeedbacksForDeviceRequestHandler.cs | Returns 200 OK with an empty JSON payload when the device isn’t found. |
| src/PepperDash.Essentials.Core/Routing/Extensions.cs | Removes route-impossibility caching and adjusts route mapping/filtering/logging. |
| src/PepperDash.Essentials.Core/DeviceTypeInterfaces/INetworkSwitchControl.cs | Introduces VLAN/PoE management interfaces and supporting event types. |
| src/PepperDash.Essentials.Core/DeviceTypeInterfaces/IHasWirelessSharing.cs | Introduces a contract for wireless sharing state feedback + change event. |
Comments suppressed due to low confidence (1)
src/PepperDash.Essentials.Core/Routing/Extensions.cs:354
sinksandsourcesare already filtered to excludeIRoutingInputsOutputsand materialized withToList(), but the nestedforeachloops re-apply the sameWherefilters. This is redundant and adds extra enumeration inside a very hot nested loop.
foreach (var sink in sinks.Where(d => !(d is IRoutingInputsOutputs)))
{
foreach (var source in sources.Where(d => !(d is IRoutingInputsOutputs)))
{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces two new device interface contracts for wireless sharing and network switch management, and makes several improvements and cleanups in routing, web API, and messaging code. The most significant changes are the addition of standardized interfaces for wireless sharing and network switch VLAN/PoE control, along with the removal of the route impossibility cache and related code in routing extensions. There are also improvements to the web API's device feedback handler and adjustments to JSON serialization for device messages.
New device interface contracts:
IHasWirelessSharinginterface and relatedWirelessSharingEventArgsclass to standardize detection and eventing of wireless presentation activity across devices like AirMedia, Solstice, etc. (IHasWirelessSharing.cs)INetworkSwitchVlanManager,INetworkSwitchPoeManager, andINetworkSwitchPoeVlanManagerinterfaces, along with supporting event argument and enum types, to provide a unified API for network switch VLAN and PoE management. (INetworkSwitchControl.cs)Routing and tie line improvements:
Extensions.cs, simplifying the routing code and removing unnecessary complexity. [1] [2] [3] [4] [5]MapDestinationsToSourcesmethod to exclude devices implementing both input and output interfaces from source/sink lists, and added verbose logging for mapped routes. [1] [2] [3] [4]Web API and messaging enhancements:
GetFeedbacksForDeviceRequestHandler.cs)DeviceMessageBaseandDeviceStateMessageBaseto ignore null values and marked theInterfacesproperty as obsolete, reflecting changes in how device interfaces are reported. [1] [2] [3]