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

Landingpage add core checks before show errors #24493

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

wendevlin
Copy link
Contributor

Proposed change

  • Show no errors when landingpage backend is down but core is not up yet.

Closes home-assistant/landingpage#147

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@wendevlin wendevlin added this to the 2025.3 milestone Mar 4, 2025
this._networkInfoError = false;
this._coreStatusChecked = false;
} catch (err) {
if (!this._coreStatusChecked) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also check supervisor status here, so do a _pingSupervisor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just check core if ping works?
No we should check core when ping or network info fails, just in case it's already there.

@wendevlin wendevlin marked this pull request as draft March 5, 2025 11:44
@@ -137,18 +118,29 @@ class HaLandingPage extends LandingPageBaseElement {

private async _fetchSupervisorInfo(schedule = false) {
try {
if (!this._networkInfo) {
Copy link
Member

Choose a reason for hiding this comment

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

why do we only ping once? are we sure that supervisor wont go down after we have a ping?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it should not go down till core starts

Copy link
Member

Choose a reason for hiding this comment

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

but it goes down when it updates, are we sure it will be done for update before we do the first check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understood it like this but I'll recheck

@wendevlin wendevlin marked this pull request as ready for review March 5, 2025 13:00
await waitForSeconds(CORE_CHECK_SECONDS);
// wait before show errors, because we assume that core is starting
this._coreCheckActive = true;
this._turnOfCoreCheck();
Copy link
Member

Choose a reason for hiding this comment

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

this._scheduleTurnOffCoreCheck();

import {
getSupervisorNetworkInfo,
pingSupervisor,
type NetworkInfo,
} from "./data/supervisor";

export const CORE_CHECK_SECONDS = 5;
export const ASSUME_CORE_START_SECONDS = 30;
export const SCHEDULE_CORE_CHECK_SECONDS = 5;
Copy link
Member

Choose a reason for hiding this comment

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

This is not used? We only check core status once now?


const SCHEDULE_CORE_CHECK_SECONDS = 5;
export const ASSUME_CORE_START_SECONDS = 30;
export const SCHEDULE_CORE_CHECK_SECONDS = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const SCHEDULE_CORE_CHECK_SECONDS = 1;
const SCHEDULE_CORE_CHECK_SECONDS = 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

404 for manifest.json
2 participants