mattcasters opened a new pull request, #8365:
URL: https://github.com/apache/hop/pull/8365
Fixes #8251
### Summary of Changes
1. **Multi-User Session Isolation & Elimination of Cross-Session Bleed**:
- Removed JVM process-wide static `instance` fields from `GitPerspective`
and `GitCommitPerspective`.
- `getInstance()` strictly resolves session-scoped perspectives via
`HopGui.findSessionPerspective(...)` and returns `null` when disabled in the
active session (rather than leaking another user's perspective).
- In `GitGuiPlugin`: `rootChanged()` now checks `isInitialized()` before
invoking perspective methods, directly fixing the `SWTException: Invalid thread
access` in Hop Web. Added `refreshGitPerspective()` to fall back safely to
`ExplorerPerspective.getInstance().refresh()` when `GitPerspective` is disabled.
2. **Defensive UI & Uninitialized State Guards**:
- Added `isInitialized()` guards and Display-thread `asyncExec` wrappers
across all public actions in `GitPerspective` and `GitCommitPerspective`.
- Added selection and null checks in `GitInfoExplorerFileTypeHandler` and
`GitPerspective.renameReference()`.
3. **Resource Leak Prevention**:
- Registered `SWT.Dispose` listeners on perspective containers to cancel
automatic fetch timers, close git repositories, and unregister from
`HopGuiKeyHandler`.
- Enclosed `PlotWalk` in `try-with-resources` blocks.
4. **Apache Commons VFS Compliance**:
- Replaced direct `java.io.File` usage with `HopVfs.getFileObject()`.
5. **Thread-Safe Configuration**:
- Synchronized configuration access in `GitConfigSingleton`.
6. **Testing & Code Formatting**:
- Expanded `GitGuiPluginSessionIsolationTest` to verify non-static
perspective singletons, uninitialized safety across all actions, and
configuration thread safety.
- All 228 tests in `plugins/misc/git` passed.
- Spotless formatting verified clean via `./mvnw spotless:check -pl
plugins/misc/git`.
------------------------
- [x] Run `mvn clean install apache-rat:check` to make sure basic checks
pass. A more thorough check will be performed on your pull request
automatically.
- [x] If you have a group of commits related to the same change, please
squash your commits into one and force push your branch using `git rebase -i`.
- [x] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable.
- [x] I hereby declare this contribution to be licensed under the [Apache
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]