-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug - global id is incorrect with multiple calls #58
Comments
25cab12 |
That commit didn't break anything. At the time To determine if the caching is at all worth it, I've made a benchmark to test how slow the create call is: require 'global_id'
require 'models/person'
require 'active_support/message_verifier'
require 'benchmark/ips'
person = Person.find(1)
GlobalID.app = 'bcx'
SignedGlobalID.verifier = ActiveSupport::MessageVerifier.new('muchSECRETsoHIDDEN')
Benchmark.ips do |x|
x.report('gid creation') { GlobalID.create(person) }
x.report('signed creation') { SignedGlobalID.create(person) }
end which results in:
Which sounds like it can generate 10k signed ids per second, if I'm reading it right. So I'm guessing we can do without the signed id cache. @jeremy, what do you think? |
The issue as it seems global id cached on the model and if it is called more than once with different params it returns wrong result.
Check this out
And compare to this:
The text was updated successfully, but these errors were encountered: