rocicorp / repc

The canonical Replicache client, implemented in Rust.
Other
30 stars 7 forks source link

Return result in uuid/mod #248

Closed arv closed 4 years ago

arv commented 4 years ago

Instead of crashing

https://github.com/rocicorp/repc/blob/ba43e47b33e5e3d32df82823d512fcc5ec831d1b/src/util/uuid/mod.rs#L15

phritz commented 4 years ago

arv this is assigned to you but unless you are going to do it asap i can knock it out. if you unassign yourself i can get to it. (i'm trying to burn through all the small issues from the milestone)

arv commented 4 years ago

I just saw that I have a branch for it... https://github.com/arv/repc/tree/uuid-result Don't know why I didn't finish that. Doing it now. Should be trivial

arv commented 4 years ago

We are using make_random_numbers in a static block. I'm tempted to add a fallback to Math.random() but in theory crypto.getRandomValues is available everywhere.

phritz commented 4 years ago

that static block doesn't require crypto randomness so math.random() is fine, just add a comment

arv commented 4 years ago

In theory Math.random() can also fail... anything that touches JS or DOM from Rust's point of view can fail. The question is just at what level we say that we trust the JS/DOM environment to work as expected?