Starcounter / starcounter-upload

Starcounter custom component to upload files over WebSocket
MIT License
0 stars 0 forks source link

Condition is always false #8

Open mmnosek opened 7 years ago

mmnosek commented 7 years ago

Steps to reproduce

  1. Run Starcounter Images app (latest develop)
  2. Go to `localhost:8080/Images
  3. Try to upload new image

Expected result

Image is uploaded successfully and websocket is closed

Actual result

Image is uploaded successfully (almost always) but websocket is never closed

Screenshot

images_and_windows_10

I've tried to debug and found one issue, but I'm not sure if it will help: This condition: https://github.com/Starcounter/starcounter-upload/blob/master/starcounter-upload.html#L224 is always false. The reason is that evt.data is a string, not a JSON object. evt.data should be parsed first.

Even without it onclose is always called, so I'm not sure if it will help with this issue.

cc @miyconst @warpech

mmnosek commented 7 years ago

Update: It is closed, but the condition in l224 is never true. should be removed or rewritten.