Desktop: Fixes #10551: Watch resources for changes when opened from the Rich Text Editor #10554
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request causes resources opened from the Rich Text Editor to be watched for changes.
The Rich Text Editor creates
file:https://
URLs for resource links. While this should prevent these links from breaking when pasted into other programs, callingopenItem
with afile:https://
link to a resource would not cause the resource to be watched (whileopenItem
with ajoplin:https://resourceidhere
-style link would). This pull request convertsfile:https://
URLs that point to resources intojoplin:https://
-style URLs before trying to parse them as resource URLs. As a result, these URLs are opened withopenItemById
and are watched for changes.Fixes #10551.
Other changes
urlUtils.js
was modified and thus migrated to TypeScript.Testing plan
This pull request includes an automated Playwright test, which runs successfully on Ubuntu 24.04 and Windows 11. In addition to this, it has been verified (on Ubuntu 24.04) that:
shows that the
blob_updated_time
property changed, when compared to its value before saving the resource.