Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328891

Summary: Sever never shows publishing state and in sync state prematurely
Product: [WebTools] WTP ServerTools Reporter: Elson Yuen <eyuen7>
Component: wst.serverAssignee: Elson Yuen <eyuen7>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: ccc, jasonxd
Version: 3.2   
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/108997
Whiteboard:
Bug Depends on: 326318    
Bug Blocks:    
Attachments:
Description Flags
v1.0 patch for 3.2M
none
v1.1 Patch for 3.3 none

Description Elson Yuen CLA 2010-10-27 17:02:12 EDT
+++ This bug was initially created as a clone of Bug #326318 +++

Build Identifier: 3.2.2

We noticed that the server never shows publishing state and it is in sync state even before the publishing is completed.

If we look at the org.eclipse.wst.server.ui.internal.cnf.ServerDecorator.getServerStatusLabel(IServer server).  The ServerContentProvider.publishing is never got set, so it will never return syncState[4], that is "Publishing."  Instead, it returns the syncState[0].  This is "Synchronized" state.

	public static String getServerStatusLabel(IServer server) {
		IStatus status = ((Server) server).getServerStatus();
		if (status != null)
			return status.getMessage();
		
		if (server.getServerType() == null)
			return "";

		if (server.getServerState() == IServer.STATE_UNKNOWN)
			return "";
		
		String serverId = server.getId();
		if (ServerContentProvider.publishing.contains(serverId))
			return ServerDecorator.syncState[4];
		
		// republish
		int i = 0;
		if (server.shouldPublish()) {
			if (((Server)server).isPublishUnknown())
				return "";
			i += 2;
		}
		
		if (server.shouldRestart())
			i = 1;
		
		return syncState[i];
	}


Reproducible: Always

Steps to Reproduce:
1. Publish a project that takes some time to publish.
2.
3.
Comment 1 Elson Yuen CLA 2010-10-27 17:11:22 EDT
Created attachment 181885 [details]
v1.0 patch for 3.2M
Comment 2 Elson Yuen CLA 2010-10-27 17:12:03 EDT
Changes committed to 32M
Comment 3 Elson Yuen CLA 2010-10-27 17:12:22 EDT
Changes released to 32M
Comment 4 Elson Yuen CLA 2010-10-27 17:15:15 EDT
Created attachment 181886 [details]
v1.1 Patch for 3.3

Patch for 3.3
Comment 5 Elson Yuen CLA 2010-10-27 17:18:47 EDT
Changes released to HEAD (3.3)
Comment 6 Elson Yuen CLA 2010-10-27 17:19:24 EDT
Code released to both 3.2M and HEAD
Comment 7 Eclipse Genie CLA 2017-10-11 16:34:50 EDT
New Gerrit change created: https://git.eclipse.org/r/108997