Skip to content

fix(developer): handle .kps file that has no <Package> element#15622

Open
mcdurdin wants to merge 1 commit intofix/developer/15619-handle-missing-info-section-in-kmp-compilerfrom
fix/developer/15621-handle-missing-package-object-in-kps-file
Open

fix(developer): handle .kps file that has no <Package> element#15622
mcdurdin wants to merge 1 commit intofix/developer/15619-handle-missing-info-section-in-kmp-compilerfrom
fix/developer/15621-handle-missing-package-object-in-kps-file

Conversation

@mcdurdin
Copy link
Member

Fixes: #15621
Fixes: KEYMAN-DEVELOPER-37D
Test-bot: skip

Fixes: #15621
Fixes: KEYMAN-DEVELOPER-37D
Test-bot: skip
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Feb 24, 2026

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

  • Developer
    • Keyman Developer - build : all tests passed (no artifacts on BuildLevel "build")
    • Compiler Regression Tests - build : all tests passed (no artifacts on BuildLevel "build")
    • Keyman Developer (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip - build : all tests passed (no artifacts on BuildLevel "build")
    • kmcomp.zip (old PRs) - build : all tests passed (no artifacts on BuildLevel "build")
  • Keyboards
    • Test Keyboards - build : all tests passed (no artifacts on BuildLevel "build")

Copy link
Contributor

@darcywong00 darcywong00 left a comment

Choose a reason for hiding this comment

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

lgtm

static ERROR_NotAPackageFile = SevError | 0x000D;
static Error_NotAPackageFile = () => m(
this.ERROR_NotAPackageFile,
`Package source file is not a valid .kps file because it is missing the <Package> root element.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 This looks like a more informative version of ERROR_InvalidPackageFile (l.62)

}

if(!kpsPackage.Package) {
this.callbacks.reportMessage(DeveloperUtilsMessages.Error_NotAPackageFile());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't l.38 generate an error message?

const kps = reader.read(input);

assert.isNull(kps);
assert.isTrue(callbacks.hasMessage(DeveloperUtilsMessages.ERROR_NotAPackageFile));
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to call callbacks.clear() between the tests in beforeEach().

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

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants