After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 767784 - picasaweb: Clarify how to handle authentication failures during upload
picasaweb: Clarify how to handle authentication failures during upload
Status: RESOLVED FIXED
Product: libgdata
Classification: Platform
Component: PicasaWeb service
git master
Other All
: Normal normal
: ---
Assigned To: libgdata-maint
libgdata-maint
Depends on:
Blocks:
 
 
Reported: 2016-06-17 10:51 UTC by Debarshi Ray
Modified: 2016-06-18 07:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
picasaweb: Clarify how to handle authentication failures during upload (1.86 KB, patch)
2016-06-17 10:54 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-06-17 10:51:32 UTC
If an application calls gdata_picasaweb_service_upload_file() without any preceeding calls to gdata_service_query() or gdata_service_insert_entry() then it is likely that the upload will fail with GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED. This is because gdata_picasaweb_service_upload_file() doesn't implicitly refresh the authorization tokens; and for good reasons too - creating a GDataUploadStream is documented as non-blocking so we can't do a blocking network call to refresh the tokens.

In fact, the gdata_authorizer_refresh_authorization documentation [1] does mention how to handle such GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED failures.

However, it only helps if you already knew about gdata_authorizer_refresh_authorization() in the first place. I think it would be nice to document this for functions (such as gdata_picasaweb_service_upload_file), which are likely to fail this way. For example, Umang, who is working on sharing photos on Google, was baffled by this problem for a day or two.

[1] https://developer.gnome.org/gdata/unstable/GDataAuthorizer.html#gdata-authorizer-refresh-authorization
Comment 1 Debarshi Ray 2016-06-17 10:54:19 UTC
Created attachment 329941 [details] [review]
picasaweb: Clarify how to handle authentication failures during upload
Comment 2 Philip Withnall 2016-06-18 03:14:28 UTC
Review of attachment 329941 [details] [review]:

Excellent.
Comment 3 Debarshi Ray 2016-06-18 07:33:25 UTC
Thanks, Philip. Pushed to master.