feat: set session uuid when creating session #4346#4496
Closed
marchetti554 wants to merge 2 commits intoory:masterfrom
Closed
feat: set session uuid when creating session #4346#4496marchetti554 wants to merge 2 commits intoory:masterfrom
marchetti554 wants to merge 2 commits intoory:masterfrom
Conversation
aeneasr
requested changes
Nov 5, 2025
Member
aeneasr
left a comment
There was a problem hiding this comment.
Thank you! To scale, the database has to pick the primary key, which is why we will never know the ID before the DB has persisted it and why we can't set it here.
We probably should add additional places where we can trigger webhooks, such as pre and post persist. This idea has existed for a while but makes hook configuration just significantly more complex and it's currently shelved on the backlog.
Author
|
@aeneasr I understand :) thank you for the feedback! |
Member
|
Closing as per #4496 (review) |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting the Session.ID when calling
NewInactiveSession()fixes this issue, where the Session ID in webhook requests appears as00000000-0000-0000-0000-000000000000because it has not yet been persisted in the database at the time the webhook executes.Related issue(s)
#4346
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
security@ory.sh) from the maintainers to push
the changes.
works.