Allow for non unique state IDs#144
Conversation
skylerkatz
left a comment
There was a problem hiding this comment.
Overall this makes sense to me, and it does resolve our issue with using legacy model records as state ids.
I still don't love the explicit reliance on Snowflakes even if you have configured some other key generation. But, that is a discussion for a different day.
…irethunk/verbs into allow-for-non-unique-state-ids
| if ($ephemeral === $not_found) { | ||
| $this->setEphemeral($target, $key, $default); | ||
| $ephemeral = $default; | ||
| } |
There was a problem hiding this comment.
This is not the standard behavior of the $default value in one of these getters, but is convenient here. I could see an argument for making this more explicit in the calling code, but it would add a number of new lines of boilerplate…
|
@skylerkatz I forgot to push up a couple changes. Can you take another look? Also—I agree that we should think about allowing Verbs to run without snowflakes at all. Let's discuss at some point. |
Right now, Verbs snapshots have a unique
idprimary key, which means that you can only have one of any given ID snapshotted at any given time. This is fine if you use snowflakes for everything, but if you don't that can be an issue.@skylerkatz and I paired on this for a while, and I know there were issues remaining, but I can't remember what they are. I'm going to post this up as a draft while I review it and maybe add some more tests.