Re: [RavenDB] Math.Random() in Patch scripts

52 views
Skip to first unread message
Message has been deleted

Oren Eini (Ayende Rahien)

unread,
Sep 15, 2015, 7:02:42 AM9/15/15
to ravendb
a) You cannot create a guid using random.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Tue, Sep 15, 2015 at 11:49 AM, Jimmy Rasmussen <jwei...@gmail.com> wrote:
Hi all,

Every call to Math.Random() in a patch script returns the same number.
I'm using Math.Random() to create GUIDs, so I need some unique numbers.
What can I do? Is this to be considered a bug?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jimmy Rasmussen

unread,
Sep 15, 2015, 7:35:45 AM9/15/15
to RavenDB - 2nd generation document database
no wonder it gives back the same result when it gets the same seed, doh! Sorry!
Message has been deleted

Oren Eini (Ayende Rahien)

unread,
Feb 3, 2016, 4:48:25 AM2/3/16
to ravendb

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Wed, Feb 3, 2016 at 5:19 AM, George Kinsman <geo...@georgekinsman.com> wrote:
Hi,

I traced this problem to a bug in Jint version 2.4, which RavenDB is still using. It was fixed in 2.4.1 in this commit: https://github.com/mediaclip/jint/commit/a74013b5e66fecd01df1d483823b8766a892db7a.

I've attempted to use several of these pseudo-rng libraries but Jint fails to parse them in the ScriptedPatchRequest, giving no error. Have you been successful in including it in a JS patch?

Thanks,
George
Reply all
Reply to author
Forward
0 new messages