Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Bug on progress event.phase of network.upload on Android
Started by Renato - Red Beach Jan 13 2014 06:55 PM

7 replies to this topic
progress event phase upload network
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Renato - Red Beach

[GLOBAL: userInfoPane.html]
Renato - Red Beach
  • Pro
  • PipPipPipPipPipPip
  • 771 posts
  • Jedi

I use the progress event.phase to update a progress widget during a image upload in my app.

 

I noticed that on iOS it works fine but on Android I only receive the 1 progress event.phase.

 

So, my progress widget starts, freezes and after few seconds, suddenly fulfill it all.

 

Is anyone seeing that same problem?

 

 

Output of a print inside the networkListener:

 

01-13 19:14:10.707: I/Corona(22521): networkListener - event.phase =	began
01-13 19:14:10.707: I/Corona(22521): networkListener - event.bytesTransferred =	0
01-13 19:14:11.363: I/Corona(22521): networkListener - event.phase =	progress
01-13 19:14:11.363: I/Corona(22521): networkListener - event.bytesTransferred =	1024
01-13 19:14:25.562: I/Corona(22521): networkListener - event.phase =	ended
01-13 19:14:25.562: I/Corona(22521): networkListener - event.bytesTransferred =	1784783



[TOPIC: post.html]
#2

Renato - Red Beach

[GLOBAL: userInfoPane.html]
Renato - Red Beach
  • Pro
  • PipPipPipPipPipPip
  • 771 posts
  • Jedi

I just noticed that the problem is solved if I use HTTP instead of HTTPS. 

 

(I though that it using bodyType = "binary" solved the problem but it did not)



[TOPIC: post.html]
#3

Renato - Red Beach

[GLOBAL: userInfoPane.html]
Renato - Red Beach
  • Pro
  • PipPipPipPipPipPip
  • 771 posts
  • Jedi

Just submitted the bug (Case 29629)



[TOPIC: post.html]
#4

keystagefun

[GLOBAL: userInfoPane.html]
keystagefun
  • Pro
  • PipPipPipPipPipPip
  • 168 posts
  • Jedi

If you set the progress parameter to "upload" then you get more frequent updates.



[TOPIC: post.html]
#5

Renato - Red Beach

[GLOBAL: userInfoPane.html]
Renato - Red Beach
  • Pro
  • PipPipPipPipPipPip
  • 771 posts
  • Jedi

Thanks for the suggestion but I tried and that does not work.

 

The docs also says that the progress parameter is a boolean param.

 

params.progress Setting to true enables the progress events. Default is nil, indicating that only the "ended" phase event is desired.

http://docs.coronalabs.com/api/library/network/upload.html


[TOPIC: post.html]
#6

keystagefun

[GLOBAL: userInfoPane.html]
keystagefun
  • Pro
  • PipPipPipPipPipPip
  • 168 posts
  • Jedi

Sorry that was for network.request - if you set the progress parameter to "upload" it works.

I've got it working with that with frequent progress updates. Can post code when I'm back in front of the computer.

[TOPIC: post.html]
#7

Renato - Red Beach

[GLOBAL: userInfoPane.html]
Renato - Red Beach
  • Pro
  • PipPipPipPipPipPip
  • 771 posts
  • Jedi

They should behave equal, since network.upload just call the network.request. The bug only happens when uploading using httpS.

 

 

UPDATE: I tried using network.request and the bug still exists



[TOPIC: post.html]
#8

keystagefun

[GLOBAL: userInfoPane.html]
keystagefun
  • Pro
  • PipPipPipPipPipPip
  • 168 posts
  • Jedi

Apologies - I wasn't using https




[topic_controls]
[/topic_controls]



Also tagged with one or more of these keywords: progress, event, phase, upload, network