taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 193 forks source link

How to make Sente + re-natal (react native) work? #339

Closed StankovicMarko closed 1 year ago

StankovicMarko commented 5 years ago

This is also posted on reddit

Few months ago i made luminus app that used sente for communication between frontend and backend. I thought it would be cool if i could reuse backend and make mobile app. I went for re-natal on AVD emulator but i am having trouble with sente.

https://gist.github.com/StankovicMarko/52db2ad96310cda46f5d35edf7dc584a This is the ns in re-natal project it's exactly the same as one on frontend and i am getting this error https://gist.github.com/StankovicMarko/d8ea2a59cd470b1fdb6db06f452b3119

which means it's breaking https://github.com/ptaoussanis/sente/blob/d29165be586f63aa3e5ae6a2c7428c750076098d/src/taoensso/sente.cljc#L1059

i tried using https://github.com/tiensonqin/lymchat as a reference only difference is newest sente version but had no success.

I thought i might've needed websocket node_module but there is one called /ws it comes with re-natal.

Does anyone know how to fix this? Has anyone tried sente and re-natal recently?

Any help is appreciated. Thank you

Edit: after talking with yogthos he confirmed that this was regression, last known working version was [com.taoensso/sente "1.10.0-SNAPSHOT"] in lymchat https://github.com/tiensonqin/lymchat/blob/master/project.clj#L9

StankovicMarko commented 5 years ago

Wanted to make an update. I managed to get it working but without csrf (i updated reddit post on how), Pass nil on client, set csrf-token-fn to nil on backend.

After that i thought i could make it work if i find a way to provide csrf but i failed. Does anyone have any suggestions on how do i provide csrf to re-natal app? Is csrf even needed when developing mobile app where backend is only used as api (no renders)?

ptaoussanis commented 1 year ago

Closing for inactivity as part of issue triage. Please feel free to re-open if this issue is still relevant!