Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn LED indicate wifi failed, cloud failed and get cloud configuration failed to off #129

Merged
merged 1 commit into from
May 16, 2024

Conversation

pnt325
Copy link
Contributor

@pnt325 pnt325 commented May 15, 2024

No description provided.

if (configuration.isOfflineMode() == false) {
if (wifiConnector.isConnected() == false) {
state = AgStateMachineWiFiLost;
} else if (apiClient.isFetchConfigureFailed()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

propose to name the method isFetchConfigurationFailed() or only fetchConfigurationFailed() would be fine too

if (wifiConnector.isConnected() == false) {
state = AgStateMachineWiFiLost;
} else if (apiClient.isFetchConfigureFailed()) {
stateMachine.displaySetAddToDashBoard();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I haven't looked at the implementation of isFetchConfigurationFailed() but in this context I can think of these cases where the message can be misleading

  1. The fetch failed because of some internet issue, e.g. timeout
  2. The fetch failed because of server overload or backend down (e.g. 503 is returned)

I think we should display this message only if the server returns a 400

@airgradienthq airgradienthq merged commit d7b5e99 into develop May 16, 2024
16 checks passed
@pnt325 pnt325 deleted the hotfix/turn-led-off-on-offlinemode branch May 16, 2024 13:32
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.

3 participants