Bug 363198 - Posting to imgur fails
Summary: Posting to imgur fails
Status: RESOLVED FIXED
Alias: None
Product: frameworks-purpose
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
: 372316 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-18 06:31 UTC by Antonio Rojas
Modified: 2016-11-11 23:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Another try to figure it out, this time in Purpose (763 bytes, patch)
2016-05-18 14:47 UTC, Aleix Pol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2016-05-18 06:31:11 UTC
With purpose 1.1rc, posting an image to imgur via the quickshare applet fails. Output is:

org.kde.plasma: unversioned plugin detected, may result in instability
kf5.kservice.sycoca: Opening ksycoca from "/home/antonio/.cache/ksycoca5_es_C7OfTnvNnOpJmtpcAjGkR1qCZY4="
kf5.kservice.sycoca: checking file timestamps
org.kde.kwindowsystem: Loaded plugin "/usr/lib/qt/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemX11Plugin.so" for platform "xcb"
org.kde.plasma: unversioned plugin detected, may result in instability
org.kde.plasma: requesting config for "Compartición rápida" without a containment!
Cannot initialize model with data QJsonObject() . missing: QJsonValue(string, "urls")
file:///usr/share/plasma/plasmoids/org.kde.plasma.quickshare/contents/ui/ShareDialog.qml:48:24: Unable to assign QJSValue to QJsonObject
file:///usr/lib/qt/qml/org/kde/purpose/RunningJob.qml:46:16: Unable to assign ulong to double
launching... "/usr/lib/kf5/purposeprocess" 0x3742dd8
"{\"mimeType\":\"image/jpeg\",\"urls\":[\"file:///home/antonio/us.jpg\"]}" QJsonObject({"mimeType":"image/jpeg","urls":["file:///home/antonio/us.jpg"]})
kf5.kjobwidgets: kuiserver found
kf5.kservice.sycoca: Opening ksycoca from "/home/antonio/.cache/ksycoca5_es_C7OfTnvNnOpJmtpcAjGkR1qCZY4="
kf5.kservice.sycoca: checking file timestamps
qml: Received undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.quickshare/contents/ui/main.qml:157: Error: Cannot assign [undefined] to QString


Reproducible: Always
Comment 1 Antonio Rojas 2016-05-18 06:35:52 UTC
When pasting text to pastebin, it works the first time, but trying to paste a second time gives the same error:
file:///usr/share/plasma/plasmoids/org.kde.plasma.quickshare/contents/ui/main.qml:157: Error: Cannot assign [undefined] to QString
Comment 2 Aleix Pol 2016-05-18 11:54:06 UTC
Hi, thanks for reporting. I've been trying to reproduce but I didn't manage to.

Can you show me what output you get with this patch?

diff --git a/applets/quickshare/plasmoid/contents/ui/main.qml b/applets/quickshare/plasmoid/contents/ui/main.qml
index c5644a4..263f1ae 100644
--- a/applets/quickshare/plasmoid/contents/ui/main.qml
+++ b/applets/quickshare/plasmoid/contents/ui/main.qml
@@ -151,6 +151,7 @@ DropArea {
             }
         }
         onFinished: {
+            console.log("finished", output, error)
             if (error==0 && output.url !== "") {
                 var resultUrl = output.url;
                 console.log("Received", resultUrl)
Comment 3 Antonio Rojas 2016-05-18 12:09:34 UTC
Now that I tried again, it seems to work sometimes. But it still fails most of the time for me (so perhaps Comment 1 wasn't accurate: it worked the second time by chance)

With the extra debug line I get
qml: finished [object Object] 0

in both cases (when it works and when it fails)
Comment 4 Aleix Pol 2016-05-18 12:13:34 UTC
Sorry, another try...

diff --git a/applets/quickshare/plasmoid/contents/ui/main.qml b/applets/quickshare/plasmoid/contents/ui/main.qml
index c5644a4..7dd435f 100644
--- a/applets/quickshare/plasmoid/contents/ui/main.qml
+++ b/applets/quickshare/plasmoid/contents/ui/main.qml
@@ -150,7 +150,17 @@ DropArea {
                 root.state = "sending"
             }
         }
+
+        function printMap(output) {
+            for(var v in output) {
+                console.log("entry", v);
+                console.log("entry-value", output[v]);
+            }
+        }
+
         onFinished: {
+            printMap(output)
+            console.log("finished", error)
             if (error==0 && output.url !== "") {
                 var resultUrl = output.url;
                 console.log("Received", resultUrl)
Comment 5 Antonio Rojas 2016-05-18 12:26:45 UTC
When it fails:
qml: entry uninitialized
qml: entry-value true
qml: finished 0
qml: Received undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.quickshare/contents/ui/main.qml:167: Error: Cannot assign [undefined] to QString

When it works:
qml: entry url
qml: entry-value http://i.imgur.com/BH397uZ.png
qml: finished 0
qml: Received http://i.imgur.com/BH397uZ.png

If there are more patches to test, please attach them, either bugzilla or firefox is screwing with the spacing.
Comment 6 Aleix Pol 2016-05-18 14:47:29 UTC
Created attachment 99052 [details]
Another try to figure it out, this time in Purpose
Comment 7 Antonio Rojas 2016-05-18 14:51:10 UTC
org.kde.plasma: unversioned plugin detected, may result in instability
org.kde.plasma: unversioned plugin detected, may result in instability
org.kde.plasma: requesting config for "Compartición rápida" without a containment!
Cannot initialize model with data QJsonObject() . missing: QJsonValue(string, "urls")
file:///usr/share/plasma/plasmoids/org.kde.plasma.quickshare/contents/ui/ShareDialog.qml:48:24: Unable to assign QJSValue to QJsonObject
file:///usr/lib/qt/qml/org/kde/purpose/RunningJob.qml:46:16: Unable to assign ulong to double
launching... "/usr/lib/libexec/kf5/purposeprocess" 0x2b44908
"{\"mimeType\":\"image/png\",\"urls\":[\"file:///home/antonio/Im\xC3\xA1genes/asistente1.png\"]}" QJsonObject({"mimeType":"image/png","urls":["file:///home/antonio/Imágenes/asistente1.png"]})
qml: lalala {"objectName":"","error":0,"errorText":"","errorString":"","percent":{},"capabilities":0,"data":{"mimeType":"image/png","urls":["file:///home/antonio/Imágenes/asistente1.png"]},"output":{"uninitialized":"true"},"percent":{}}
qml: entry uninitialized
qml: entry-value true
qml: finished 0
qml: Received undefined
file:///usr/share/plasma/plasmoids/org.kde.plasma.quickshare/contents/ui/main.qml:167: Error: Cannot assign [undefined] to QString
Comment 8 Aleix Pol 2016-05-18 15:46:02 UTC
It looks to me that you're hitting an error in the plugin and it's not being reported correctly. I just pushed some changes to purpose 1.1 branch. Can you please give it a try?
Comment 9 Antonio Rojas 2016-05-18 15:54:53 UTC
I don't get any additional output with 1.1 head (as of commit b7e8598)
Comment 10 Aleix Pol 2016-05-19 01:11:32 UTC
Git commit 20c3204caa50a3f1a731c50df20c51cc7395cd32 by Aleix Pol.
Committed on 19/05/2016 at 01:03.
Pushed by apol into branch '1.1'.

Make sure that all information has flowed in before giving up on the job

Sometimes important information sent right before finishing can be lost.

M  +3    -1    src/externalprocess/processjob.cpp

http://commits.kde.org/purpose/20c3204caa50a3f1a731c50df20c51cc7395cd32
Comment 11 Aleix Pol 2016-11-11 23:29:13 UTC
*** Bug 372316 has been marked as a duplicate of this bug. ***