Skip to content

feat(core): check on load for valid kmx_plus unicode 🙀 #13486

Merged
srl295 merged 15 commits intomasterfrom
feat/core/9446-detect-bad-unicode-kmxplus
Mar 19, 2025
Merged

feat(core): check on load for valid kmx_plus unicode 🙀 #13486
srl295 merged 15 commits intomasterfrom
feat/core/9446-detect-bad-unicode-kmxplus

Conversation

@srl295
Copy link
Copy Markdown
Member

@srl295 srl295 commented Mar 12, 2025

  • error out if failure
  • includes tests
  • also, improve validation within kmxplus, we were not propagating all validation errors early enough. The implication of this is that transforms might for example appear to just be 'missing' rather than failing out with a validation error. There was not a stability risk that I could see, but we could have had a corrupted keyboard that lacked functions rather than refusing to load.
  • update docs around kmxplus validity

Fixes: #9446

@keymanapp-test-bot skip

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Mar 12, 2025
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Mar 12, 2025

@keymanapp-test-bot keymanapp-test-bot bot added this to the B18S3 milestone Mar 12, 2025
@github-actions github-actions bot added core/ Keyman Core feat labels Mar 12, 2025
@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Mar 12, 2025
@srl295 srl295 changed the base branch from master to chore/core/9446-kmx-plus-tests-gtest March 13, 2025 20:08
@srl295 srl295 changed the title feat(core): check on load for valid kmx_plus unicode feat(core): check on load for valid kmx_plus unicode 🙀 Mar 13, 2025
@github-actions github-actions bot added common/ and removed common/ labels Mar 13, 2025
- turn off some asserts- makes untestable
(there are asserts at 'higher levels' such as loading the entire kmx+)
- add a test with a synthesized COMP_KMXPLUS_STRS - a valid and an invalid one

Fixes: #9446
@github-actions github-actions bot added common/ and removed common/ labels Mar 13, 2025
@srl295 srl295 marked this pull request as ready for review March 13, 2025 22:18
@srl295 srl295 requested review from mcdurdin and rc-swag as code owners March 13, 2025 22:18
@srl295 srl295 requested a review from markcsinclair March 13, 2025 22:18
- not counting markers, which have a special path

Fixes: #9446
@github-actions github-actions bot added common/ and removed common/ labels Mar 13, 2025
@srl295
Copy link
Copy Markdown
Member Author

srl295 commented Mar 14, 2025 via email

Base automatically changed from chore/core/9446-kmx-plus-tests-gtest to master March 14, 2025 14:18
@github-actions github-actions bot removed the common/ label Mar 14, 2025
- add test case
- turn this into not be an assert, so we can test it

Fixes: #9446
@srl295
Copy link
Copy Markdown
Member Author

srl295 commented Mar 14, 2025

well, this actually opened a bit of a can of worms around is-valid but I'm working on it!

- improve how validation works - a missing section does not mean an invalid section. distingush these.
- propagate errors for invalid sections
- update documentation of required sections

Fixes: #9446
@github-actions github-actions bot added common/ and removed common/ labels Mar 14, 2025
- reinstate 'most or all sections' note
- reflow lines

Fixes: #9446
@github-actions github-actions bot added common/ and removed common/ labels Mar 14, 2025
@srl295 srl295 requested a review from mcdurdin March 14, 2025 20:40
@srl295
Copy link
Copy Markdown
Member Author

srl295 commented Mar 14, 2025

@mcdurdin I ended up not being able to test without some updates this given the state of validation propagation! It would actually be more challenging to split this PR, so for review just review the additional commits since you last looked at it.

@darcywong00 darcywong00 modified the milestones: B18S3, B18S4 Mar 14, 2025
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

I have made some suggestions but they are really nits and polish, so this LGTM. Good work, nice to see robust error handling

srl295 and others added 2 commits March 17, 2025 11:26
- improve an output string
- catch BMP noncharacters besides U+FFFF (H/T @mcdurdin - this was the whole point of the PR) plus test

Fixes: #9446

Co-authored-by: Marc Durdin <marc@durdin.net>
- restructured validation calls to be more consistent

Fixes: #9446
@github-actions github-actions bot added common/ and removed common/ labels Mar 17, 2025
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

I have made some suggestions but they are really nits and polish

I guess one of the suggestions was a bit more significant than a nit, glad to see it has landed!

- update per review notes

Fixes: #9446
@github-actions github-actions bot added common/ and removed common/ labels Mar 18, 2025
@srl295 srl295 merged commit 4c36f07 into master Mar 19, 2025
20 checks passed
@srl295 srl295 deleted the feat/core/9446-detect-bad-unicode-kmxplus branch March 19, 2025 15:22
@github-project-automation github-project-automation bot moved this to Done in Keyman Mar 19, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 19.0.16-alpha

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

feat(core,developer): detect bad unicode in kmxplus 🙀

4 participants