Closed lancegliser closed 1 year ago
@ca98am79 I'll try to keep to JS only, but the Types need some work too. Would you be adverse in the future to moving to tsc
?
@lancegliser that is fine with me, thank you
@ca98am79 The README currently has this warning:
- `reapInterval` Legacy session expiration cleanup in milliseconds. Should instead enable [DynamoDB TTL](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) and select the `expires` field. **BREAKING CHANGE** from v1.0.11 to v2.0.0 for reaping sessions with changes to the format of the expires field timestamp.
I've for now updated to:
- `reapInterval` Legacy session expiration cleanup in milliseconds.
☣️ Legacy reap behaviors use DynamoDB [scan](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-dynamodb/classes/scancommand.html)
functionality that can incur significant costs. Should instead enable [DynamoDB TTL](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html)
and select the `expires` field.
Since we're already making a breaking change, would it be better to remove that and help users avoid shooting themselves in the foot with potential costs? I should be able to use new UpdateTimeToLiveCommand() to apply a sensible default or take it as an option? Related to #72
@ca98am79 Alright my friend. I've got this to the point it works when manually npm pack
ed into my project. I'm ready to have you review it.
A few things that might come as surprises I'll explain:
(err, { expiration })
as callback. That's not exactly what's in express's API. They claim it returns nothing at all. I think that's fine?getItem
was never called anymore. Depending on sequence, send
might have been called to: describe table, create table, or get item. I probably could code around that, but it felt like too much knowledge of internals again. Decided I'd just extract the part being tested for more direct access.async () => new Promise
all over. This was because the errors in the code were not being show in the tests. The callback style if err throw err
weren't part of strict operational control flow. It's been replaced with if err return reject(err)
all over to expose those.@ca98am79 We're online using this for a couple weeks now via npm pack
install. Can I help in any way to get this merged and published?
@ca98am79 Noticed an issue today trying to upgrade from 16.x to 18.x on an AWS Lambda today. I traced it back to the this branch and the package I'd built from it. Wanted to use ScalarAttributeType.*
, and it worked on 16.x. I assume 16.x just took the property as the value so ".N" came out correct. 18.x throws an error. I pushed and updated to fix it. Would love to get this published so we can properly version!
Agreed, can we have this reviewed and merged. It is tough to have multiple mocked AWS clients across my different application with AWS sdk different versions.
thank you, sorry for the delay
Starting work on #71. Just a draft for visibility as I start hacking at it.
index.d.ts
updates for options.Changes (I'd suggest squash merging to these 😅)