[Ur] Unsafe GET and slow message passing

Ziv Scully ziv at mit.edu
Sat Aug 29 01:16:57 EDT 2015


I'm working on a game in Ur/Web that uses message passing for communication
between the players in very similar fashion to the official Chat demo.
Overall, things have been great, but I've run into two issues.

(1) Say that [handler : unit -> transaction page] makes a write to a
database. Normally we can't just use [handler] as a link without a
[safeGet] in the relevant .urp file. However without exposing [handler] in
the .urs file or adding the [safeGet], we can do
[<form><submit={handler}></form>]. This makes [handler] accessible by
simply typing in a URL, even if it has destructive effects, because the
form handler expects no fields. There's a simple workaround for now: add a
[<hidden{#Dummy}/>] to the form (and change the type of [handler]
accordingly).

(2) Sometimes doing "many" (order of 6) channel operations slows down the
server considerably, causing all requests to stall for a bit. The stall
isn't permanent, but often after the stall resolves, some small subset of
the messages don't make it to their recipients. The clients who missed
messages might still receive future messages but will never receive the
ones they missed. I found that something similar occurs with the official
Chat demo (try joining the same channel in ~8 tabs in quick succession), so
I don't think the issue is specific to my app. Has anyone run into this
before? I messed with the .urp file a little bit but nothing helped.

My code is here: https://github.com/vizziv/Resistance
Chat demo is the last demo here: http://www.impredicative.com/ur/demo/

Thanks for any help or advice!
Ziv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150829/c5d8a059/attachment.html>


More information about the Ur mailing list