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

Mobile,Desktop,Cli: Improve search engine error handling when preparing text for search #9871

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

Allows search indexing to continue and log the failed note ID if text normalization fails. It seems that removeDiacritics can fail in some cases.

See https://discourse.joplinapp.org/t/search-not-working-on-ios/35754.

@laurent22
Copy link
Owner

A test is failing even after retry. Would increasing the max number of retries help in this case?

➤ YN0000: [@joplin/lib]: PASS services/search/SearchEngine.test.js
➤ YN0000: [@joplin/app-desktop]:   1) main.spec.ts:136:6 › main › should correctly resize large images ──────────────────────────────
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:     Error: locator.waitFor: Error: strict mode violation: getByAltText('large-jpg-image-with-exif-rotation.jpg') resolved to 2 elements:
➤ YN0000: [@joplin/app-desktop]:         1) <img title="" data-from-md="" alt="large-jpg-image-wi…/> aka getByRole('img', { name: 'large-jpg-image-with-exif-' }).first()
➤ YN0000: [@joplin/app-desktop]:         2) <img title="" data-from-md="" alt="large-jpg-image-wi…/> aka getByRole('img', { name: 'large-jpg-image-with-exif-' }).nth(1)
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:     Call log:
➤ YN0000: [@joplin/app-desktop]:       - waiting for getByAltText('large-jpg-image-with-exif-rotation.jpg') to be visible
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:       157 | 			const viewerFrame = editor.getNoteViewerIframe();
➤ YN0000: [@joplin/app-desktop]:       158 | 			const renderedImage = viewerFrame.getByAltText(filename);
➤ YN0000: [@joplin/app-desktop]:     > 159 | 			await renderedImage.waitFor();
➤ YN0000: [@joplin/app-desktop]:           | 			                    ^
➤ YN0000: [@joplin/app-desktop]:       160 |
➤ YN0000: [@joplin/app-desktop]:       161 | 			// We load a copy of the image to avoid returning an overriden width set with
➤ YN0000: [@joplin/app-desktop]:       162 | 			//    .width = some_number
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:         at getImageSize (/home/runner/work/joplin/joplin/packages/app-desktop/integration-tests/main.spec.ts:159:24)
➤ YN0000: [@joplin/app-desktop]:         at /home/runner/work/joplin/joplin/packages/app-desktop/integration-tests/main.spec.ts:173:26
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:     Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:     Error: locator.waitFor: Timeout 30000ms exceeded.
➤ YN0000: [@joplin/app-desktop]:     Call log:
➤ YN0000: [@joplin/app-desktop]:       - waiting for getByAltText('large-jpg-image-with-exif-rotation.jpg') to be visible
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]:       -   locator resolved to hidden <img title="" data-from-md="" alt="large-jpg-image-wi…/>
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:       157 | 			const viewerFrame = editor.getNoteViewerIframe();
➤ YN0000: [@joplin/app-desktop]:       158 | 			const renderedImage = viewerFrame.getByAltText(filename);
➤ YN0000: [@joplin/app-desktop]:     > 159 | 			await renderedImage.waitFor();
➤ YN0000: [@joplin/app-desktop]:           | 			                    ^
➤ YN0000: [@joplin/app-desktop]:       160 |
➤ YN0000: [@joplin/app-desktop]:       161 | 			// We load a copy of the image to avoid returning an overriden width set with
➤ YN0000: [@joplin/app-desktop]:       162 | 			//    .width = some_number
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:         at getImageSize (/home/runner/work/joplin/joplin/packages/app-desktop/integration-tests/main.spec.ts:159:24)
➤ YN0000: [@joplin/app-desktop]:         at /home/runner/work/joplin/joplin/packages/app-desktop/integration-tests/main.spec.ts:173:26
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:     attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────
➤ YN0000: [@joplin/app-desktop]:     test-results/main-main-should-correctly-resize-large-images-retry1/trace.zip
➤ YN0000: [@joplin/app-desktop]:     Usage:
➤ YN0000: [@joplin/app-desktop]: 
➤ YN0000: [@joplin/app-desktop]:         yarn playwright show-trace test-results/main-main-should-correctly-resize-large-images-retry1/trace.zip

@personalizedrefrigerator
Copy link
Collaborator Author

A test is failing even after retry. Would increasing the max number of retries help in this case?

See #9873 and #9874. I think it's related to the size of the window used to run the Playwright tests.

@laurent22 laurent22 merged commit 296d586 into laurent22:dev Feb 9, 2024
10 checks passed
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