Is a periodic license check during an IDEA session even necessary?

The article about implementing a license check says

(!) For the release version of the IDE, the plugin license will be checked on start. If there is no license provided in the dialog and there is no evaluation available, the plugin will be disabled and won't be loaded at all. If the license would be removed/expired when the plugin is already loaded, it's technically impossible to unload the plugin, so it will be working until the IDE is restarted.

This means that IDEA will check the license at start-up anyway and that the verification calls through isLicensed() is an additional measure to make a plugin defunct if, e.g. its license expires while having IDEA already open. I'm having a hard time thinking about how I can restrict/defunct my custom language plugin without accidentally annoying users. I have thought of 3 ways:

  • Use a StartupActivity to check the license and if it fails I don't register, e.g. CompletionProviders or Annotators/Inspections. This would limit the usability drastically but since IDEA performs a license check at startup anyway and disables my plugin if necessary, this is of course useless.
  • Call isLicensed() during the runtime when for instance highlighting or completion is invoked. I could then disable these features.
  • Call isLicensed() periodically every 10min and simply annoy the user with a dialog that says "You don't have a valid license"

I'm very hesitant to implement any of these options. For one, I don't think calling isLicensed() inside a feature that runs often is a good idea. What happens if the user loses internet-connection and the license check fails although they have a valid substription? Second, most important features of a language plugin like annotators, inspections, completion, indexing, etc. run very often and I wouldn't like to impact the performance negatively by adding a license check there.

My personal opinion is that I would be OK if the plugin license is checked only once at start-up. Even if that means some users can use the plugin without a valid license simply because they haven't closed IDEA yet.

What do other developers think about this? In which places are you putting the license check?

0
1 comment

> This means that IDEA will check the license at start-up anyway and that the verification calls through isLicensed() is an additional measure to make a plugin defunct if, e.g. its license expires while having IDEA already open.

Yes, but using isLicensed() is also important to have some additional protection against hackers because IDEA license checking for a plugin can be easily disabled by removing <product-descriptor> from plugin.xml. Also IDEA Community edition or older IDEA Ultimate versions do not check plugin license at start-up.

Where to invoke isLicensed() depends on the plugin. In case of my plugin, which adds an GUI form editor for a specific file type, it it done each time when the user opens a form editor.

Periodically calling isLicensed() every 10min is IMO far to often. Daily (or hourly) would be enough.

 

> What happens if the user loses internet-connection and the license check fails although they have a valid substription?

Calling isLicensed() does not access the internet. It simply gets some key from a map in class LicensingFacade. IDEA fills this map at startup and from the Register dialog. Maybe IDEA periodically connects to a license server (in the background) to update the map? Don't know.

0

Please sign in to leave a comment.