AMO:Users/Checking For Updates

From MozillaWiki
Jump to: navigation, search

The Update Service:

  • checks for updates to the addons on a background timer
  • provides a means for the user to check for updates to the application
  • provide a set of controls for determining update behavior

The Background Timer

The system will automatically check for updates without user intervention:

  • every 24 hours

Regarding critical security updates, it would be useful to the user, if we could display a pop-up or similar sort (like what we have for-- " New updates available ") with the importance of this critical security update. This way we can inform the user the urgent need for the upgrade.

The Update Check

  1. generate update service URL
  2. determine if updates are available
  3. determine action
  4. download patches
  5. verify patches
  6. install patches

Update Service URL

The Service URL needs to incorporate data in these dimensions so as to reduce the complexity of the processing on the client side:

  • request version
  • app id
  • app version
  • addon id
  • addon version
  • target operating system
  • target architecture

e.g.

VersionCheck.php?reqVersion=1&id={8620c15f-30dc-4dba-a131-7c5d20cf4a29}&version=0.6.5&maxAppVersion=1.0%2B&appID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}&appVersion=1.4&appOS=WINNT&appABI=x86-msvc

The Updates File

VersionCheck.php returns an XML file that tells about available updates. It is formatted like this:

<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<RDF:Description about="urn:mozilla:extension:{ffffffff-dddd-4dba-a131-aaaaaaaaaaaa}">
 <em:updates><RDF:Seq>
  <RDF:li resource="urn:mozilla:extension:{ffffffff-dddd-4dba-a131-aaaaaaaaaaaa}:0.1"/>
 </RDF:Seq></em:updates>
</RDF:Description>

<RDF:Description about="urn:mozilla:extension:{ffffffff-dddd-4dba-a131-aaaaaaaaaaaa}:0.1">
 <em:version>0.1</em:version>
 <em:targetApplication>

  <RDF:Description>
   <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
   <em:minVersion>1.0</em:minVersion>
   <em:maxVersion>1.0+</em:maxVersion>
   <em:updateLink>http://ftp.mozilla.org/pub/mozilla.org/extensions/myaddon/addon-0.1-fx+mz+tb.xpi</em:updateLink>
  </RDF:Description>
 </em:targetApplication>

</RDF:Description>
</RDF:RDF>

This includes the UUID of the addon and the UUID of the application.

On the client side:

Preference Controls and State

  • extensions.update.enabled
trueEnables background update checking
falseDisables background update checking
  • app.update.interval
86400seconds between update checks
  • extensions.update.lastUpdateDate
1114648397seconds since epoch of last update time
  • extensions.update.severity.threshold
1???
  • extensions.update.url
https://addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%
%REQ_VERSION% is the version of the request; %ITEM_ID% is the UUID of the addon; %ITEM_VERSION% is the version of the addon being inquired about; %ITEM_MAXAPPVERSION% is the maximum application version the addons is known to work with; %APP_ID% is the UUID of the application; %APP_VERSION% is the version of the application; %APP_OS% is the target OS; %APP_ABI is the target architecture%