Brewskey / spark-server

An API compatible open source server for interacting with devices speaking the spark-protocol
https://www.particle.io/
GNU Affero General Public License v3.0
54 stars 27 forks source link

It seems that the "get events" features didn't work very well #247

Closed jinyangqiao closed 7 years ago

jinyangqiao commented 7 years ago

When I use the GET /v1/events GET /v1/events/:event_name /v1/devices/events......, I found that when I try to access the link of 'http://my cloud Ip:8080/v1/events?access_token=my token' in my Google Chrome,I didn't get any response, and it's always in the pending state until 503 not found. I don't know it's why, who can help me? /(ㄒoㄒ)/~~ thanks!

AntonPuko commented 7 years ago

event endpoints are events streams, they generaly used for particle subscribe and you can get it with any other sse client. I'm not sure if chrome supports it. upd: just tried with chrome, it works too: 123

It can be another issue though, It seems our keep alive doesn't work properly and it disconnects if there is no one event happened before the timeout.

jlkalberer commented 7 years ago

Sounds like the keep alive should be removed for those endpoints

jinyangqiao commented 7 years ago

I'm sorry I'm late, I tried it just now and found that when I used the default admin token, it's always in the pending. but when I used the token belongs to the user of the device,it worked properly.

jlkalberer commented 7 years ago

Ahh... yeah, that makes sense. @AntonPuko - I don't think the admin token has access to all devices.. This should be fixed