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

Desktop: Resolves #11575: Move "URI malformed" alert to the log #11576

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

wh201906
Copy link
Contributor

@wh201906 wh201906 commented Jan 4, 2025

Resolves #11575

The "URI malformed" alert is triggered here.

const link = decodeURI(encodedLink);

The "malformed" link is less likely to be a Resource URI, so we can leave it as it is. I add the catch statement to prevent the alert dialog and log it as a warning.

@wh201906
Copy link
Contributor Author

wh201906 commented Jan 4, 2025

We can also log it with logger.info() rather than logger.warn(), For the "malformed" link, the content won't be changed and it doesn't affect the APP so no need to worry about it.

@laurent22
Copy link
Owner

Thanks for the pr. Is there not a built-in logger in importers with this.logger? (Sorry don't have the code in front of me)

@wh201906
Copy link
Contributor Author

wh201906 commented Jan 4, 2025

There isn't such a logger in InteropService_Importer_Md and InteropService_Importer_Base, so I added it.

@laurent22
Copy link
Owner

No that's fine, no need to add it in this case. But we have a test file - any chance you could add a test based on it?

@wh201906
Copy link
Contributor Author

wh201906 commented Jan 4, 2025

No that's fine, no need to add it in this case.

@laurent22 So I don't even need to log the URI malformed alert in the log, right?

But we have a test file - any chance you could add a test based on it?

I've added it in commit d577ea9. The new test fails on the current dev branch (commit 2b43a9a), which is expected.
The new test is based on should not fail to import file that contains a link to a file that does not exist and should not import resources from file:// links

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.

Fix uir malformed issue
2 participants