CloudStorage calls hang outside initial callback

Jun 6, 2011 at 6:50 AM

Hello,

First off, thanks for making such an simple API for cloud storage access. I'm having problems with any call to CloudStorage hanging after the initial BeginOpenRequest callback. In my app I create a CloudStorage object at main app level. I then pass this into various parts that need it. On a login screen I use the BeginOpenRequest method to open a connection and store the token. Then I move the app to a new screen. In the new screen I make a call to say GetRoot() or GetFolder() so that I can list out the contents in that screen. Unfortunately I never get a return from the call. I don't understand why this would be happening because CloudStorage.IsOpen returns true. Is the API intended to execute all commands in a single open request callback and then immediately close? That seems awfully inefficient to constantly have to open and close connections. Am I missing something?

Thanks in advance!

Coordinator
Jun 6, 2011 at 8:42 PM
Hi,

are you on Windows Phone 7 or on Windows 7? If you are on Windows Phone 7 it would realy help to get a small sample application for debugging. Does this error occures with our dropbox browser for WP7 as well?

Thanks
Dirk

2011/6/6 caskater4 <notifications@codeplex.com>

From: caskater4

Hello,

First off, thanks for making such an simple API for cloud storage access. I'm having problems with any call to CloudStorage hanging after the initial BeginOpenRequest callback. In my app I create a CloudStorage object at main app level. I then pass this into various parts that need it. On a login screen I use the BeginOpenRequest method to open a connection and store the token. Then I move the app to a new screen. In the new screen I make a call to say GetRoot() or GetFolder() so that I can list out the contents in that screen. Unfortunately I never get a return from the call. I don't understand why this would be happening because CloudStorage.IsOpen returns true. Is the API intended to execute all commands in a single open request callback and then immediately close? That seems awfully inefficient to constantly have to open and close connections. Am I missing something?

Thanks in advance!

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jun 6, 2011 at 9:05 PM
This is occurring on Windows Phone 7. The problem does occur with the Dropbox Browser but only when I rearrange the code to function the way i'm describing. I'll try and outline the changes I made below.

MainPage.xaml.cs

void Login(token)
{
...
_storage.BeginOpenRequest(...);
}

void Login(user,pass)
{
...
_storage.BeginOpenRequest(...);
}

void AsyncRequestCallback()
{
// Save token to internal storage
...
// Navigate to next page
NavigationService.Navigate(new Uri("/DetailsPage.xaml"));
}

void MainPage_Loaded(...)
{
// Load token from internal storage
if (token) Login(token);
}

void login_Click(...)
{
Login(edtUsername.Text, edtPassword.Password);
}

DetailsPage.xaml.cs

void DetailsPage_Loaded(...)
{
// Retrieve root directory
ICloudDirectoryEntry root = storage.GetRoot();

foreach (ICloudFileSystemEntry entry in root)
{
Items.Add(entry);
}
}

On Mon, Jun 6, 2011 at 1:42 PM, dei79 <notifications@codeplex.com> wrote:

From: dei79

Hi,

are you on Windows Phone 7 or on Windows 7? If you are on Windows Phone 7 it would realy help to get a small sample application for debugging. Does this error occures with our dropbox browser for WP7 as well?

Thanks
Dirk

2011/6/6 caskater4 <notifications@codeplex.com>

From: caskater4

Hello,

First off, thanks for making such an simple API for cloud storage access. I'm having problems with any call to CloudStorage hanging after the initial BeginOpenRequest callback. In my app I create a CloudStorage object at main app level. I then pass this into various parts that need it. On a login screen I use the BeginOpenRequest method to open a connection and store the token. Then I move the app to a new screen. In the new screen I make a call to say GetRoot() or GetFolder() so that I can list out the contents in that screen. Unfortunately I never get a return from the call. I don't understand why this would be happening because CloudStorage.IsOpen returns true. Is the API intended to execute all commands in a single open request callback and then immediately close? That seems awfully inefficient to constantly have to open and close connections. Am I missing something?

Thanks in advance!

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jun 9, 2011 at 1:33 AM

Can I assume from the lack of response that this is not the way the API is intended to be used? That CloudStorage objects should be used only once per request and then destroyed?

Coordinator
Jun 9, 2011 at 6:52 AM
Hi,

no it's ok to use the CloudStorage object more then one time, I had currently no time to test your code. I will do this next week in a special bugfixing session :-)

Sorry
Dirk


2011/6/9 caskater4 <notifications@codeplex.com>

From: caskater4

Can I assume from the lack of response that this is not the way the API is intended to be used? That CloudStorage objects should be used only once per request and then destroyed?

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Jun 10, 2011 at 5:06 PM
Hi,

I adjusted a little bit the existing async API and rearranged the tool in a similar way then you did it: http://sharpbox.codeplex.com/SourceControl/changeset/changes/75341

Check it!

Thanks
Dirk


2011/6/9 Dirk Eisenberg <dirk.eisenberg@gmail.com>
Hi,

no it's ok to use the CloudStorage object more then one time, I had currently no time to test your code. I will do this next week in a special bugfixing session :-)

Sorry
Dirk


2011/6/9 caskater4 <notifications@codeplex.com>

From: caskater4

Can I assume from the lack of response that this is not the way the API is intended to be used? That CloudStorage objects should be used only once per request and then destroyed?

Read the full discussion online.

To add a post to this discussion, reply to this email (sharpbox@discussions.codeplex.com)

To start a new discussion for this project, email sharpbox@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com



Aug 18, 2011 at 2:45 AM
Edited Aug 18, 2011 at 2:52 AM

Hello,

I still have this issue in 1.1.0 release

I use following steps to reproduce on DropBoxBrowser.WP7 sample:

1) Add Click handler to ListBox in ShowDataPage.xaml:31

 

<ListBox Height="595" HorizontalAlignment="Left" Margin="12,6,0,0" Name="lstItems" VerticalAlignment="Top" Width="438" 
  SelectionChanged="lstItems_SelectionChanged" Loaded="listBox1_Loaded" />

 

2) Add handler to code behind

 

private void lstItems_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
   var entry = (App.Current as DropBoxBrowser.WP7.App).Root.GetChild(0);
}

Click on ListBox item, code will lock on access Root from Main UI thread.

 

Update: Now i found BeginGetChildsRequest method, will try to use

Coordinator
Aug 19, 2011 at 11:16 PM
Hi,

it is a good idea to use the asynchronous call in WP7. Some new calls are only implemented in the trunk so check out the code.

Dirk

Sent from my iPad

On 18.08.2011, at 04:45, "ep_wp7"<notifications@codeplex.com> wrote:

From: ep_wp7

Hello,

I still have this issue in 1.1.0 release

I use following steps to reproduce on DropBoxBrowser.WP7 sample:

1) Add Click handler to ListBox in ShowDataPage.xaml:31

<ListBox Height="595" HorizontalAlignment="Left" Margin="12,6,0,0" Name="lstItems" VerticalAlignment="Top" Width="438" 
  SelectionChanged="lstItems_SelectionChanged" Loaded="listBox1_Loaded" />

2) Add handler to code behind

private void lstItems_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
   var entry = (App.Current as DropBoxBrowser.WP7.App).Root.GetChild(0);
}

Click on ListBox item, code will lock on access Root from Main UI thread.