Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2771] Android: Facebook publish stream does clear/reset its data

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:02.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M04
ComponentsAndroid
Labelsandroid, defect, enterprise, facebook, regression, release-1.6.0, reported-1.5.1, rplist
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:29:05.000+0000
Updated2011-04-17T02:00:02.000+0000

Description

From Fred:

Login and tap 'Post 01'. Rather than submitting, close and tap 'Post 02' - It's using the same data from the first publish, even though the data is different in source. App data has to be completely cleared before this stops, but it continues to use the same publish data from the first publish request.

app.js:

var win = Ti.UI.createWindow();
var fbBtn = Ti.Facebook.createLoginButton({
    'style':'wide',
    'apikey':'9494e611f2a93b8d7bfcdfa8cefdaf9f',
    'sessionProxy':'http://api.appcelerator.net/p/fbconnect/',
    bottom:10
});

var post01Btn = Ti.UI.createButton({ title:'Post 01', left:10, right:10, top:10, height:30 });
var post02Btn = Ti.UI.createButton({ title:'Post 02', left:10, right:10, top:50, height:30 });

post01Btn.addEventListener('click', function(e) {
    if (Ti.Facebook.isLoggedIn()) {
        var data = {
            "name": "Sample Title 01",
            "href": "http://google.com",
            "description": "Sample Description 01",
            "caption": "Sent via a test Appcelerator App."
        };
        
        Ti.Facebook.publishStream("POST NUMBER 01", data, null, function(r) {                     
            if (r.success) {
                alert('Posted.');
            } else {
                alert('Not Posted.');
            }
        });
    }
});

post02Btn.addEventListener('click', function(e) {
    if (Ti.Facebook.isLoggedIn()) {
        var data = {
            "name": "Sample Title 02",
            "href": "http://google.com",
            "description": "Sample Description 02",
            "caption": "Sent via a test Appcelerator App."
        };
        
        Ti.Facebook.publishStream("POST NUMBER 02", data, null, function(r) {                     
            if (r.success) {
                alert('Posted.');
            } else {
                alert('Not Posted.');
            }
        });
    }
});

win.add(post01Btn);
win.add(post02Btn);
win.add(fbBtn);
win.open();

Comments

  1. Bill Dawson 2011-04-15

    (from [c1584226b7836da0ed07d1dedc290bcd9dee5b0c]) [#2771 state:fixed-in-qa] Our new remote image cache seems to cache all requests made on Java HttpURLConnection, not just those for images. Facebook dialog to publish stream uses HttpUrlConnection and the same query string (with different post data), and the same cached response was being shown over and over again. Explicitly disable caching on HttpUrlConnection objects used in Facebook module. https://github.com/appcelerator/titanium_mobile/commit/c1584226b7836da0ed07d1dedc290bcd9dee5b0c"> https://github.com/appcelerator/titanium_mobile/commit/c1584226b783...

  2. Bill Dawson 2011-04-15

    This bug makes multiple publishing of stream/status updates impossible in the same running FB session under Titanium 1.5.X, therefore I'll also cherry-pick to 1.5.X.

  3. Bill Dawson 2011-04-15

    (from [682e79e0d2a24922bfff09c5aa9a87504b3714e8]) [#2771 state:fixed-in-qa] Our new remote image cache seems to cache all requests made on Java HttpURLConnection, not just those for images. Facebook dialog to publish stream uses HttpUrlConnection and the same query string (with different post data), and the same cached response was being shown over and over again. Explicitly disable caching on HttpUrlConnection objects used in Facebook module. https://github.com/appcelerator/titanium_mobile/commit/682e79e0d2a24922bfff09c5aa9a87504b3714e8"> https://github.com/appcelerator/titanium_mobile/commit/682e79e0d2a2...

  4. Bill Dawson 2011-04-15

    (from [95363ab6703354bd71d35a7f553c6c3b997a8910]) [#2771] Update KS Facebook 'publish stream' test to include indication that cached responses are not being used. https://github.com/appcelerator/titanium_mobile/commit/95363ab6703354bd71d35a7f553c6c3b997a8910"> https://github.com/appcelerator/titanium_mobile/commit/95363ab67033...

  5. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06) still need to check in 1.5.2

  6. Thomas Huelbert 2011-04-15

    [INFO] Titanium SDK version: 1.5.2 (01/14/11 10:34 8e8e048) 1.6 and 2.2.1

JSON Source