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

Fix demo when there's no recorder available #21519

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/layouts/home-assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
}

protected async checkDataBaseMigration() {
if (!this.hass?.config?.components.includes("recorder")) {
this._databaseMigration = false;
return;
}
Comment on lines +203 to +206
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This won't be the correct fix since the PR introducing it mentions:
We can't check for recorder in hass.config.components, it won't be added until after the migration has completed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code mentions that people would have been able to run Home Assistant without recorder in earlier versions. Since it checked upon recorder and putted database migration on false if it doesn't exist. That no longer happens, therefore doesn't load the frontend anymore. (But I'm not sure if people run HA without recorder...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From theory to practice: It definitely runs pretty decent if you have no recorder set up. Graphs and everything related is taken away. Broken on current dev.

Copy link
Member

@bramkragten bramkragten Aug 1, 2024

Choose a reason for hiding this comment

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

Line 215 should have handled this, but for demo this is a bit different, so we can just skip all of this for __DEMO__ or mock the command.

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've retested this, checked the code and it works with no recorder as well. All good.


let recorderInfoProm: Promise<RecorderInfo> | undefined;
const preloadWindow = window as WindowWithPreloads;
// On first load, we speed up loading page by having recorderInfoProm ready
Expand Down
Loading