Ubuntu.Web’s WebView.getUAString() is racy by design

Bug #1399601 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Medium
Unassigned
webbrowser-app
Fix Released
High
Olivier Tilloy
webbrowser-app (Ubuntu)
Fix Released
Undecided
Olivier Tilloy
webbrowser-app (Ubuntu RTM)
Fix Released
Undecided
Olivier Tilloy

Bug Description

See http://developer.ubuntu.com/api/qml/sdk-14.10/Ubuntu.Web.WebView/#getUAString-method for documentation.

This method is being called by the WebView in Component.onCompleted, and sets the shared context’s default user agent. If the WebView is instantiated with a url set, the first HTTP request is issued before getUAString() is called, and thus potentially with the wrong UA string.

This API is racy by design, there’s really no way to fix it.

There are currently 2 apps in the store using this API:

    com.viclog.2048
    com.viclog.flappybird

and 3 more using it with the UbuntuWebView, which is version 0.1 of the API, based on QtWebKit:

    com.ubuntu.developer.andrewsomething.stackbrowser
    com.ubuntu.developer.daker.x-type
    com.ubuntu.developer.fcole90.feedspot

Seeing those relatively small numbers, I think it’s a good opportunity to remove the API altogether, after ensuring that the apps are fixed to not use it. Documentation will need to be updated.

UPDATE: as of 2014-12-11, com.viclog.2048 and com.viclog.flappybird have been updated in the store, they no longer use WebView.getUAString(). So effectively no application uses the API, and it should be safe to remove it.

Related branches

Olivier Tilloy (osomon)
summary: - Ubuntu.Web’s WebView.getUAString() is racy
+ Ubuntu.Web’s WebView.getUAString() is racy by design
Revision history for this message
Victor Thompson (vthompson) wrote :

Updates to com.viclog.2048 and com.viclog.flappybird to not use the getUAString() API call have been submitted to the store.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Awesome, thanks Victor!

With that, it should now be safe to remove the API altogether, knowing that it wouldn’t break any existing app in the store.

Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: Triaged → In Progress
Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
status: New → In Progress
Changed in webbrowser-app (Ubuntu RTM):
status: New → Confirmed
Olivier Tilloy (osomon)
description: updated
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

ok to land to deprecate the API, but not top priority

Changed in canonical-devices-system-image:
importance: Undecided → Medium
milestone: none → ww51-2014
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+15.04.20141212-0ubuntu1

---------------
webbrowser-app (0.23+15.04.20141212-0ubuntu1) vivid; urgency=low

  [ Olivier Tilloy ]
  * Remove the WebView.getUAString() API from version 0.2 of the
    Ubuntu.Web module. It is currently not in use by any app in the
    store. (LP: #1399601)
 -- Ubuntu daily release <email address hidden> Fri, 12 Dec 2014 11:32:16 +0000

Changed in webbrowser-app (Ubuntu):
status: In Progress → Fix Released
Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
Changed in webbrowser-app (Ubuntu RTM):
status: Confirmed → In Progress
Changed in webbrowser-app (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu RTM):
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Added a utopic task, as apparently this needs to be backported to utopic for the current online docs to be updated (there are no separate docs for RTM, all there is is docs for 14.10, which RTM is based on).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+15.04.20141212~rtm-0ubuntu1

---------------
webbrowser-app (0.23+15.04.20141212~rtm-0ubuntu1) 14.09; urgency=low

  [ Olivier Tilloy ]
  * Remove the WebView.getUAString() API from version 0.2 of the
    Ubuntu.Web module. It is currently not in use by any app in the
    store. (LP: #1399601)
 -- Ubuntu daily release <email address hidden> Fri, 12 Dec 2014 11:32:23 +0000

Changed in webbrowser-app (Ubuntu RTM):
status: In Progress → Fix Released
Changed in canonical-devices-system-image:
status: Confirmed → Fix Released
Olivier Tilloy (osomon)
no longer affects: webbrowser-app/utopic
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.