Make sure linked preferences remain in-sync after external file change - #2914
Make sure linked preferences remain in-sync after external file change#2914ptziegler wants to merge 1 commit into
Conversation
|
Here's a short video demonstrating the problem. When restoring the original preferences by clicking on "Replace with HEAD revision", I would expect the project scope of the project with those linked preferences to also update. This doesn't happen and instead it's stuck with the outdated scope. Screencast_20260908_224550.webm |
There was a problem hiding this comment.
🟡 Changes recommended
Reverse alias refresh remains incomplete, and the external-change test may be flaky due to timestamp granularity.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates project preference synchronization when linked preference files change externally.
Changes:
- Refreshes metadata for changed linked files.
- Adds linked-project preference synchronization tests.
File summaries
| File | Description |
|---|---|
RefreshLocalVisitor.java |
Reloads metadata for changed linked files. |
ProjectPreferencesTest.java |
Tests linked preference synchronization paths. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7092e38 to
ff9ec1e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new test must create project2’s .settings parent folder before creating the link.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
|
|
||
| IFile prefFile1 = getFileInWorkspace(project1, nodeName); | ||
| IFile prefFile2 = getFileInWorkspace(project2, nodeName); | ||
| prefFile2.createLink(prefFile1.getLocationURI(), IResource.ALLOW_MISSING_LOCAL, createTestMonitor()); |
There was a problem hiding this comment.
That is not true. When project2 is created, the Platform automatically creates the .settings/org.eclipse.core.resources.prefs file. So the settings folder will always exist, which is also the reason why no error is thrown when executing the test without this change.
Test Results 45 files - 9 45 suites - 9 55m 37s ⏱️ - 3m 32s For more details on these failures, see this check. Results for commit 67e12fd. ± Comparison against base commit e9ab4bb. This pull request removes 220 and adds 3 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
ff9ec1e to
a34a529
Compare
|
I wonder about the general handling of the tree under a linked folder. E.g., if one linked the .settings folder, would that have similar/different problems with respect the the IDE seeing the preference changes? |
Of course links are not restricted to files, just try to use "new folder" wizard :-) |
One can check, with real FS links it works for sure, probably also should work with "virtual", we link .settings since years on Linux. |
Good point, I missed that it's a different wizard. After a quick test I can tell that when the folder is linked and the preference file is changed, the test is still successful, regardless of whether the refresh is done on the file or the folder (and also fails without the change). Which I don't think is really surprising, because when a folder is linked, the containing files are obviously also linked. The only relevant part is that a resource-changed event is fired for the file. Though I'll try to write a dedicated test for that once I'm back at my PC.
I don't have any way of testing that. |
a34a529 to
14bcc05
Compare
|
I've added an additional test case to also check the correctness when linking folders. Regarding virtual file systems: As said before, I don't have any means of testing this. But conceptually, the only requirement is that resource-change events are fired correctly. |
I probably was not clear enough in my previous comment. Links you were fixing/testing here are "Eclipse-only", thus "virtual", compared with real file system links. |
14bcc05 to
965873b
Compare
Ah, you meant physical and symbolic links. Yes, those won't work (yet) because they aren't tracked by the alias-manager. I've added a new test case which covers this configuration as well, but which will fail. |
When a preference file is changed by an external process (e.g. a Git update), it may happen that the preference node for projects that link to this file are not updated properly. Those projects will then continue working with outdated preferences, until either the application is restarted or the preference file is manually updated.
965873b to
67e12fd
Compare
Bug 198291 - AliasManager should track symlinks |



When a preference file is changed by an external process (e.g. a Git update), it may happen that the preference node for projects that link to this file are not updated properly. Those projects will then continue working with outdated preferences, until either the application is restarted or the preference file is manually updated.