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(ignore): Fix 2 to 3 migration enabling frontend/availabilty/homeassistant when not set #25349

Merged
merged 6 commits into from
Dec 30, 2024

Conversation

Koenkk
Copy link
Owner

@Koenkk Koenkk commented Dec 28, 2024

Fix issue with the 2 to 3 migration enabling features when not set, e.g. before this PR:

homeassistant: false

would result in

homeassistant:
  enabled: false
frontend:
  enabled: true
availability:
  enabled: true

This PR fixes that

@Koenkk Koenkk requested a review from Nerivec December 28, 2024 13:46
@Nerivec
Copy link
Collaborator

Nerivec commented Dec 28, 2024

The problem appears to be in getValue rather (validPath should be false):

if (i === path.length - 1) {
return [true, currentSettings[key]];
} else {

        if (i === path.length - 1) {
            const setting = currentSettings[key];

            return [setting != undefined, setting];
        } else {

That should also fix the improper log in your test.

            expect(migrationNotesContent).toContain(`[SPECIAL] Property 'homeassistant' is now always an object.`);
-            expect(migrationNotesContent).toContain(`[SPECIAL] Property 'frontend' is now always an object.`);
-            expect(migrationNotesContent).toContain(`[SPECIAL] Property 'availability' is now always an object.`);

@Koenkk
Copy link
Owner Author

Koenkk commented Dec 28, 2024

@Nerivec I think I fixed it correctly now.

@Koenkk Koenkk merged commit 02666e9 into dev Dec 30, 2024
21 checks passed
@Koenkk Koenkk deleted the fix/migrate-2-to-3 branch December 30, 2024 13:22
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.

2 participants