Conversation
19c000e to
67b1217
Compare
|
@robinpokorny Sorry for the delay on this. I'm kind of hoping @pmccarren will chime in here. If this is very-urgent and pmccaren deems it appropriate we can push this out. But I'm not thrilled about adding yet-more internal state variables without being a bit more deliberate in how we handle them. I'm thinking it might be worth refactoring this code to formalize the internal state as a data structure that is used both internally or that can be optionally passed as an option. And then break the v6() method into two parts:
That might be a breaking change though...? So maybe we push this out, then actually-fix how we handle internal state separately and maybe push that out with the breaking-changes in the TS port work. |
|
@broofa, sound good! Regarding the options, I was thinking there's one more. We can disable passing your own timestamp, for now, and only allow current time. For this use case it works quite well and I assume it's the most common one. The proper support for custom timestamp could be added later. |
|
Moving this to #776 |
This PR enables users to provide custom timestamp when generating v7. If fixes previous problems described in #764
Implementation details
Previously we stored the previous timestamp together with any advancements. So we loose the information of the last supplied timestamp. I fixed it by storing the timestamp from which the advancements start, so we can determine if the new timestamp is in that window.
Also,
seqreset did not work at all as the condition was reversed.Benchmark
Main branch:
After: