-
Notifications
You must be signed in to change notification settings - Fork 31
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
KV store generation integer follow up (#1029) #1108
Conversation
@@ -11,6 +11,9 @@ const { DICTIONARY_NAME, CONFIG_STORE_NAME, KV_STORE_NAME, SECRET_STORE_NAME } = | |||
getEnv(serviceName); | |||
|
|||
function existingStoreId(stores, existingName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in setting up my fastly secret-store, it got into a state where it was null and throw an exception. Not sure if this is necessary or just something I encountered while trying to setup the integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, it would be interesting to dig into the caller of this function, to see what that is happening and potentially resolve the issue at the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!JS_GetProperty(cx, opts_val, "gen", &gen_val)) { | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the generation match integer comes across as a uint64_t, however I'm not converting it to uint64. I noticed some functions in spidermonkey that had a comment of it being non-standard, could/should I be using those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the support for BigInt can be useful for 64 bit integers effectively supporting gen: 1000n
as well as gen: 1000
say. The BigInt functions are exactly what you want to use and there should be existing examples in the codebase for this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a good example of converting a RootedBigInt
and converting that to a uint64_t, so I left it as a number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great start!
Would be worth adding a test for some of the error cases.
There's also the docs/documentation/kv-store
documentation to update as well.
if (!JS_GetProperty(cx, opts_val, "gen", &gen_val)) { | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the support for BigInt can be useful for 64 bit integers effectively supporting gen: 1000n
as well as gen: 1000
say. The BigInt functions are exactly what you want to use and there should be existing examples in the codebase for this as well.
@@ -11,6 +11,9 @@ const { DICTIONARY_NAME, CONFIG_STORE_NAME, KV_STORE_NAME, SECRET_STORE_NAME } = | |||
getEnv(serviceName); | |||
|
|||
function existingStoreId(stores, existingName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, it would be interesting to dig into the caller of this function, to see what that is happening and potentially resolve the issue at the root.
Thanks I updated the related documentation, I'd appreciate your input on the wording. I'll look to add more error cases. |
You can run For the other test failures, this is actually a CI issue that we don't clean up the secret stores properly. I've posted #1110. Otherwise looks like this is good to land to me! |
follow up to #1029