buildship icon indicating copy to clipboard operation
buildship copied to clipboard

Gradle tasks fail to load upon Eclipse start, manual refresh works as expected

Open vredez opened this issue 1 year ago • 2 comments

Expected Behavior

  • Open workspace with Gradle project
  • Gradle tasks are loaded successfully

Current Behavior

  • Open workspace with Gradle project
  • Gradle tasks are not loaded (error icon is shown within the view Gradle Tasks)
  • Tasks load just fine when performing a manual refresh of Gradle tasks

Steps to Reproduce

  • create a new empty Gradle project
  • exit Eclipse
  • start Eclipse and reopen workspace --> Gradle tasks fail to load

Your Environment

  • Eclipse Buildship 3.1.9.v20240115-1636
  • Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) Version: 2024-03 (4.31.0) Build id: 20240307-1437
  • vanilla eclipse.ini
  • Windows 11 21H2

vredez avatar Apr 05 '24 13:04 vredez

With https://github.com/eclipse/buildship/pull/1240 (commit: https://github.com/eclipse/buildship/commit/dcdf121d6356bed9c7278a3023d8263aeaf3c61a) the fetch strategy has been changed when populating the Gradle Tasks view. Before the change this has been LOAD_IF_NOT_CACHED. Now it is FROM_CACHE_ONLY.

Here is the relevant comment from the code:

// set initial content (use fetch strategy FROM_CACHE_ONLY as we don't want to enforce // a potentially expensive sync operation just because a view was opened)

So, this behavior is intentional.

One possible solution could be the introduction of a new preference option Refresh tasks when opening the Tasks View. When checked, the task view will always be populated when it is opened.

oleosterhagen avatar May 18 '24 17:05 oleosterhagen

Good to know that this is desired behavior. From a users perspective it really seems like a bug though, for two reasons:

  • Error icon is shown initially (which is the same as if errors occurred)
  • Undocumented change of behavior w.r.t. prior releases

I can see the benefits of not loading the tasks automatically (especially since Eclipse gets slower every release anyways), but maybe a better indication of "not yet loaded" tasks could be implemented (question mark instead of error indicator for example).

vredez avatar May 20 '24 18:05 vredez