In some cases when add-ins are downgraded the add-in database may be left in an invalid status. This happened because the add-in scanner did not properly compare the versions of the old and the new add-in, so it did not uninstall the old add-in when versions were different. This resulted on the old and new descriptions of the add-in to be kept in the database, and it might generate add-in dependency errors.
This also happened when upgrading, but since the engine always loads add-ins with the highest version it doesn't matter if there is one with lower version also registered.
The solution is to cache information about the old add-in version, and when comparing ids, use that information.
In some cases when add-ins are downgraded the add-in database may be left in an invalid status. This happened because the add-in scanner did not properly compare the versions of the old and the new add-in, so it did not uninstall the old add-in when versions were different. This resulted on the old and new descriptions of the add-in to be kept in the database, and it might generate add-in dependency errors.
This also happened when upgrading, but since the engine always loads add-ins with the highest version it doesn't matter if there is one with lower version also registered.
The solution is to cache information about the old add-in version, and when comparing ids, use that information.
Added unit tests.