bamaer commented on PR #8635:
URL: https://github.com/apache/hop/pull/8635#issuecomment-5854639410

   The three `check()` fixes are right and the tests pin the behaviour that 
matters. Two gaps in the linter part; both are follow-up-able, so this can go 
in as-is, but it's cleaner with them.
   
   **An in-flight pass still publishes after the switch goes off.** The guards 
are all at the scheduling boundary, none at the publish. `lintProjectAsync` 
(`BackgroundLintService.java:169`) calls `updateResultsForFile` per file in a 
loop that runs a while on a big project, and `lintFileInternal` (`:336`) 
doesn't check at all. Switch the linter off mid-pass and those findings land 
after `applyEnabledState()` has called `clearResults()`. The Explorer and the 
canvas are covered by their own guards, but 
`PipelineProblemsTabSync.refreshForFile` reads the manager unguarded, so the 
Problems tab shows lint findings with the linter off until the option is 
toggled again. One choke point covers every producer:
   
   ```java
   public synchronized void updateResultsForFile(String filePath, 
List<LintResult> results) {
     if (!LinterConfigPlugin.getInstance().isLinterEnabled()) {
       return;
     }
   ```
   
   **Re-enabling doesn't restore the Problems bar on editors opened while 
off.** `attachToGraph` only runs from `EditorLintSupport.onNewGraph`, which now 
returns early when disabled. `applyEnabledState()` re-lints, so the canvas 
totals come back, but `refreshAllOpenEditors()` walks `filePathByGraphId` — 
never populated for those graphs — and `refreshForFile` is deliberately 
passive. The bar returns only once the user edits the file. Attaching the open 
graphs on the enable path fixes it, walking them the way 
`LintEditorGraphHelper.findAmongOpenEditors` already does:
   
   ```java
   for (TabItemHandler item : HopGui.getExplorerPerspective().getItems()) {
     if (item.getTypeHandler() instanceof HopGuiAbstractGraph graph && 
!graph.isDisposed()) {
       EditorLintSupport.onNewGraph(graph);
     }
   }
   ```
   


-- 
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]

Reply via email to