Bug 574622 - Remembered accepted licenses are not persisted
Summary: Remembered accepted licenses are not persisted
Status: VERIFIED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 4.20   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.21 M2   Edit
Assignee: Hannes Wellmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy, usability
Depends on:
Blocks: 574014
  Show dependency tree
 
Reported: 2021-07-02 11:11 EDT by Hannes Wellmann CLA
Modified: 2021-07-27 08:26 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Wellmann CLA 2021-07-02 11:11:43 EDT
The licences accepted in the AcceptLicensesWizardPage are remembered by the SimpleLicenseManager of Equinox-p2.
Unfortunately it seems like the remembered accepted licenses are not persisted.

I've installed new software to a new stand-alone "Eclipse IDE for Java Developers 2021-06" and accepted the licence of the new software (in my case something from the Sim-Rel realeses repo, where mostly the "Eclipse Foundation Software User Agreement" is used).
When I don't restart after the installation and additionally install other new software with the same licence, I don't get prompted to accept that licence again. So far so good.
But after a restart I have to accept the licence of new software again even tough it is exactly the same licence text (I used a diff-tool to verify it).

I put a break-point into SimpleLicenseManager.initializeFromPreferences() and debugged the mentioned Eclipse as a Remote Java Application and noticed that the "digestList" load from the preferences is always empty. When I accept licences they are added to the 'accepted'-set of the SimpleLicenseManager as expected.
Furthermore I noticed that the prefs-file "p2\org.eclipse.equinox.p2.engine\profileRegistry\epp.package.java.profile\.data\.settings\org.eclipse.equinox.p2.ui.sdk.prefs" within my Eclipse installation, which I assume is supposed to store the preference, never contains any corresponding entry.

Therefore I think the problem is that the remembered licenses are not properly persisted.
It looks like the problem can be solved if in SimpleLicenseManager.updatePreferences() the updated preferences are flushed.

Or is there a better, more general solution?
Comment 1 Eclipse Genie CLA 2021-07-02 11:16:51 EDT
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/182707
Comment 3 Lars Vogel CLA 2021-07-26 11:27:15 EDT
Thanks, Hannes. Can you add a small entry to the N&N for 4.21? See https://git.eclipse.org/r/q/project:www.eclipse.org/eclipse/news for an examples.
Comment 4 Eclipse Genie CLA 2021-07-26 16:13:45 EDT
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/183391
Comment 5 Hannes Wellmann CLA 2021-07-26 16:15:40 EDT
(In reply to Lars Vogel from comment #3)
> Thanks, Hannes. Can you add a small entry to the N&N for 4.21? See
> https://git.eclipse.org/r/q/project:www.eclipse.org/eclipse/news for an
> examples.

Your welcome and thanks for reviewing.
Sure, the N&N change was just submitted.
Comment 7 Lars Vogel CLA 2021-07-27 04:01:11 EDT
Thanks, Hannes. Please test with the next I-Build.
Comment 8 Hannes Wellmann CLA 2021-07-27 08:03:16 EDT
I have just verified it with I-Build I20210726-1800 (the first one that included this change) and everything works fine.
After the first new software is installed, I don't get asked to accept the licences of further new software that uses the same license.
Comment 9 Lars Vogel CLA 2021-07-27 08:26:25 EDT
(In reply to Hannes Wellmann from comment #8)
> I have just verified it with I-Build I20210726-1800 (the first one that
> included this change) and everything works fine.
> After the first new software is installed, I don't get asked to accept the
> licences of further new software that uses the same license.

Thanks again, Hannes.