Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@valtzu
Copy link
Contributor

@valtzu valtzu commented Mar 23, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
License MIT

The Lock documentation mentions that the lock keys are serializable – however, it seems that's the case only if you're using native php serializer.

I'm proposing to add LockKeyNormalizer to make the example in the docs work the same when using Symfony Serializer too.

@valtzu valtzu requested a review from jderusse as a code owner March 23, 2025 12:41
@carsonbot carsonbot added this to the 7.3 milestone Mar 23, 2025
@valtzu valtzu force-pushed the lock-normalizer branch 2 times, most recently from 89d05b7 to d1cd6e1 Compare March 23, 2025 12:51
@valtzu valtzu force-pushed the lock-normalizer branch from ab729b1 to a9201d2 Compare July 21, 2025 10:33
@valtzu valtzu force-pushed the lock-normalizer branch 2 times, most recently from 090db9a to be1f46f Compare August 23, 2025 15:15
@valtzu
Copy link
Contributor Author

valtzu commented Aug 23, 2025

Since native serialization is handled within Key class, maybe it'd make sense to do the same for JSON? Just remove the LockKeyNormalizer and implement \JsonSerializable on Key instead. What do you think?

EDIT: right, it would not work on deserialization..

@valtzu valtzu force-pushed the lock-normalizer branch 2 times, most recently from 4264be0 to 9a45e82 Compare August 23, 2025 15:32
@valtzu valtzu changed the title [Lock] Add LockKeyNormalizer [Lock][FrameworkBundle] Add LockKeyNormalizer Aug 23, 2025
@carsonbot carsonbot changed the title [Lock][FrameworkBundle] Add LockKeyNormalizer [Lock] Add LockKeyNormalizer Sep 4, 2025
@fabpot
Copy link
Member

fabpot commented Sep 17, 2025

Thank you @valtzu.

@fabpot fabpot merged commit 2d6913c into symfony:7.4 Sep 17, 2025
11 of 12 checks passed
@stof
Copy link
Member

stof commented Sep 17, 2025

@valtzu another reason: symfony/serializer is not just about JSON.

This was referenced Oct 27, 2025
nicolas-grekas added a commit that referenced this pull request Dec 5, 2025
…nicolas-grekas)

This PR was merged into the 7.4 branch.

Discussion
----------

[Lock] Fix unserializing already serialized Key payloads

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #62585
| License       | MIT

Issue introduced in #60023

Commits
-------

44cf8da [Lock] Fix unserializing already serialized Key payloads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants