Do not coerce session keys to strings for getters/setters#523
Open
radar wants to merge 1 commit into
Open
Conversation
1c932ee to
2095179
Compare
parndt
approved these changes
Jul 5, 2026
Contributor
|
Nice; I've definitely had this issue in the past. |
Member
|
Thanks for this, @radar! I think this is a good change. One thing I want to do with this is have a closer poke at the ramifications for our Rack 2/3 compatibility. This string-key-ifying session wrapper was introduced in #477 as part of our Rack 3 compatibility effort, and I just want to be doubly sure that we're not introducing any regressions (the fact that our tests are happy is a good sign!). |
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.
I came across a bug today where I had this code in my action's test:
But then when attempting to access the session's value in the action's code:
This is because the previous implementation was stringifying keys. There wasn't a session key stored as
"user_id"in the session, so it returnsnil.This PR removes the cooercing-to-string of these values. So whatever is put in there is now maintained in the data type it was insertedin.