GNOME Bugzilla – Bug 767784
picasaweb: Clarify how to handle authentication failures during upload
Last modified: 2016-06-18 07:33:47 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
Created attachment 329941 [details] [review] picasaweb: Clarify how to handle authentication failures during upload
Review of attachment 329941 [details] [review]: Excellent.
Thanks, Philip. Pushed to master.