-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow for non unique state IDs #144
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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…
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 think it is fine
@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. |
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.
LGTM
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.
New changes LGTM
Right now, Verbs snapshots have a unique
id
primary 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.