signageful / client

0 stars 0 forks source link

Display Fallback Content When Network is Down #3

Closed juliankoehn closed 1 year ago

juliankoehn commented 1 year ago

Problem Statement

When the digital signage player is not connected to the network, it should display a fallback content, such as a video, instead of the regular digital signage content.

Proposed Solution

The solution involves checking the network connection regularly in Golang and emitting an event to the frontend using a service provider (ctx.Hub.BroadcastMessage(message)) whenever the network connection state changes (i.e. goes online or offline). The TypeScript code using React will listen for these events and set the network connection status in state accordingly, rendering the fallback content if the network is down.

Acceptance Criteria

Definition of Done

Implementation Steps

  1. Write the Golang code to check the network connection regularly and emit an event to the frontend whenever the connection state changes
  2. Write the TypeScript code using React to render the fallback content if the network is down, responding to the events from the Golang code
  3. Integrate the code into the digital signage player and test thoroughly
  4. Deploy the solution to the production environment and monitor for any issues

Estimated Time to Complete

juliankoehn commented 1 year ago

The implementation for the use case has deviated from the proposed solution in that Golang was not used.

Instead, the Network Detector has been built directly into the player using TypeScript. The Network Detector displays a status screen when the network is unavailable and displays the regular player content when the network is available. The solution meets the acceptance criteria, as it displays the fallback content (status screen) when the network is down and displays the regular player content when the network is available. The code has been thoroughly tested and is functioning as expected.

ETA

The implementation of the solution took approximately 3 hours to complete. The next step is testing, for which the update will be pushed to the Edge Channel and tested on an endpoint device. This is expected to take 2-3 hours.

juliankoehn commented 1 year ago

Problem description

When the network cable is unplugged, the screensaver correctly displays, but upon replugging, the player does not seem to be able to find the network and displays a blank screen.

Expected behavior

When the network cable is replugged, the player should be able to reconnect to the network and continue playing the content as normal.

Steps to reproduce

  1. Connect the player to the network using an Ethernet cable.
  2. Wait for the player to successfully connect to the network and start playing the content.
  3. Unplug the Ethernet cable.
  4. Wait for the screensaver to display.
  5. Replug the Ethernet cable.
  6. Observe the player display a blank screen instead of the expected content.

Impact

This issue prevents the player from being able to reconnect to the network and display content after a network interruption, resulting in an unsatisfactory user experience.

juliankoehn commented 1 year ago

Test steps:

Test result:

The fallback content was displayed as expected when the network was down (step 2). The system was able to recover from the network failure and resumed normal operation after the cable was reconnected and a few seconds had passed (step 4).

Conclusion:

The fallback content display function works as expected. This resolves this issue.