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

Port the fuzzy scoring function to C #385

Conversation

EbonJaeger
Copy link
Member

Description

When transpiling to C, Vala really mangles this function, causing it to crash randomly on non-Latin text. Porting it to C and checking it against the reference implementation found online fixes the crashing issue while (as far as I can tell with Spanish) still producing the desired search results.

Another consideration was converting the search text and compare text to ASCII. This method also seems to fix the issue, though it feels more dirty. I decided to go forward with the C port because I simply can't trust Vala to do the right thing when it comes to this function.

Fixes #383

Submitter Checklist

  • Squashed commits with git rebase -i (if needed)
  • Built budgie-desktop and verified that the patch worked (if needed)

@EbonJaeger EbonJaeger added the bug Something isn't working label May 29, 2023
@serebit serebit added this to the 10.8 milestone Jul 7, 2023
@JoshStrobl JoshStrobl self-requested a review July 10, 2023 13:42
Copy link
Member

@JoshStrobl JoshStrobl left a comment

Choose a reason for hiding this comment

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

LGTM. @EbonJaeger you can land once it's rebased.

@JoshStrobl
Copy link
Member

nvm fixing it myself :D

When transpiling to C, Vala really mangles this function, causing it to crash randomly on non-Latin text. Porting it to C and checking it against the reference implementation found online fixes the crashing issue while (as far as I can tell with Spanish) still producing the desired search results.

Another consideration was converting the search text and compare text to ASCII. This method also seems to fix the issue, though it feels more dirty. I decided to go forward with the C port because I simply can't trust Vala to do the right thing when it comes to this function.

Ref #383

Signed-off-by: Evan Maddock <maddock.evan@vivaldi.net>
@JoshStrobl JoshStrobl force-pushed the 383-application-search-through-budgie-menu-crashes-budgie-desktop-and-forces-to-log-out branch from 10f0691 to 814a525 Compare July 10, 2023 13:46
@JoshStrobl JoshStrobl merged commit 05bd0bf into main Jul 10, 2023
1 check passed
@JoshStrobl JoshStrobl deleted the 383-application-search-through-budgie-menu-crashes-budgie-desktop-and-forces-to-log-out branch July 10, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Application search through Budgie Menu crashes budgie-desktop and forces to log out
3 participants