xwikisas / application-googleapps

Google Apps Integration
0 stars 4 forks source link

The Google Apps Administration configuration page is not removed after application uninstall #65

Open ilieandriuta opened 2 years ago

ilieandriuta commented 2 years ago

Environment: Windows 11 Pro 64bit, Chrome 102 using a local instance of XWiki 14.4 on Oracle 19c, Tomcat 9.0.63, Java 17 (Oracle) , Google Apps Integration (Pro) 2.5.2

STEPS TO REPRODUCE

  1. Uninstall Google Apps Integration (Pro)
  2. Go to Administer Wiki > Other
  3. Observe the accordion

EXPECTED RESULTS

The page related to Google Apps Integration (Pro) is removed.

ACTUAL RESULTS

The configuration page is still there, but is named googleapps. If clicked, it contains only the following string googleapps.config.heading.

It is to be mentioned that the following lines were removed from xwiki.cfg and the instance was restarted before attempting uninstall of the application:

# xwiki.authentication.authclass=com.xpn.xwiki.user.impl.xwiki.GroovyAuthServiceImpl
# xwiki.authentication.groovy.pagename=xwiki:GoogleApps.AuthService

image

ilieandriuta commented 2 years ago

After further testing I've noticed that the issue is related to GoogleAppsConfig page that is not being selected by default to be removed in the uninstallation steps. If Google Apps Integration is installed and the configuration page from Administration is left untouched and the application is then uninstalled, the GoogleAppsConfig page is being selected (and the configuration page from Administration is removed):

image

But if the configuration page from Administration is saved by the user (by changing of one or more settings) and then the application is uninstalled, the GoogleAppsConfig page is not being selected anymore (it must be ticked manually):

image

Maybe this is expected, but it may be an usability issue for the users.

mflorea commented 2 years ago

The Extension Manager deselects by default the extension pages that have been modified in order to preserve user customizations. Of course, the administrator can select those pages if they think the customizations done are not important. This actually replicates the behavior you see on your OS: uninstalling an application normally leaves its configuration (in case you reinstall the application).

The problem with the Google Apps extension is that GoogleAppsConfig page stores both the configuration (that the user changes) and the "code" to extend the Administration menu. This follows the "Configurable Class" documentation so in a sense it does follow the best practice. This means that any XWiki extension that follows the same documentation will have the same problem: if the user modifies the default configuration then the configuration page will, by default, remain after uninstall and this will keep the entry in the Administration menu. This deserves a discussion on XWiki product and a generic solution that any extension can apply.

ndascalita commented 7 months ago

Tested on XWiki 14.10.16 with Google Apps Integration (Pro) 2.6 - The configuration page is still there, but after re-indexing it dissapears. Also clicking on it doesn't do anything except refreshing the page.