Skip to content

Codec messenger serialization issues#1240

Merged
andrew-welker merged 2 commits into
developmentfrom
codec-messenger-issues
Apr 2, 2025
Merged

Codec messenger serialization issues#1240
andrew-welker merged 2 commits into
developmentfrom
codec-messenger-issues

Conversation

@andrew-welker
Copy link
Copy Markdown
Contributor

  • fix: bring modifications made to plugin over
  • fix: ignore CameraBase routing port list

Andrew Welker added 2 commits April 2, 2025 10:00
The `RoutingPortCollection` type appears to not be currently
serializable. If a class that contains this collection is going to be
serialized, the collection should have the `JsonIgnore` attribute added.
If the list is needed, use a conversion object and convert it to a
regular list.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses codec messenger serialization issues by incorporating plugin modifications, ignoring the CameraBase routing port list, and improving error handling and logging across various messenger modules. Key changes include:

  • Registering messengers post-initialization with detailed logging.
  • Refactoring handler lookup for improved message matching.
  • Adding try/catch blocks with enhanced error logging and updating endpoint naming conventions.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/PepperDash.Essentials.MobileControl/MobileControlSystemController.cs Added logging after initialization and refined message handler retrieval.
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/VideoCodecBaseMessenger.cs Wrapped several methods in try/catch blocks and improved error logging.
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/MessengerBase.cs Updated error logging implementation with consistent token initialization.
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/ISelectableItemsMessenger.cs Introduced try/catch in status messaging and defined a generic state message class.
src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DevicePresetsModelMessenger.cs Renamed action endpoints to remove the "/presets" prefix.
src/PepperDash.Essentials.Devices.Common/Cameras/CameraBase.cs Added JsonIgnore to the OutputPorts property.
src/PepperDash.Essentials.Core/Routing/* Applied minor changes to using directives and added JsonIgnore to ParentDevice references.
Comments suppressed due to low confidence (3)

src/PepperDash.Essentials.MobileControl.Messengers/Messengers/DevicePresetsModelMessenger.cs:46

  • Changing the endpoint from "/presets/fullStatus" to "/fullStatus" may break existing integrations. Please confirm that this change is intentional and update related documentation or client configurations accordingly.
AddAction("/fullStatus", (id, content) =>

src/PepperDash.Essentials.MobileControl.Messengers/Messengers/ISelectableItemsMessenger.cs:76

  • [nitpick] Consider passing the exception object directly to the log method for improved diagnostics, for example: this.LogError(e, "Error sending full status");
this.LogError("Error sending full status: {0}", e.Message);

src/PepperDash.Essentials.MobileControl.Messengers/Messengers/VideoCodecBaseMessenger.cs:779

  • [nitpick] Returning null in the GetStatus method could lead to NullReferenceExceptions in downstream consumers. Consider returning a default state object instead of null.
return null;

@andrew-welker andrew-welker merged commit b77fc36 into development Apr 2, 2025
2 checks passed
@andrew-welker andrew-welker deleted the codec-messenger-issues branch April 2, 2025 17:05
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

Successfully merging this pull request may close these issues.

4 participants