Skip to content
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

How to handle code changes in Notification Classes #130

Open
FredrikPAC opened this issue Apr 17, 2024 · 1 comment
Open

How to handle code changes in Notification Classes #130

FredrikPAC opened this issue Apr 17, 2024 · 1 comment

Comments

@FredrikPAC
Copy link

Hi everyone!
We're stumbling on alot of issues surrounding the unserialization of older notifications which have had their code changed.
We're using a postgres db, so the column is base64_encoded. How are you guys handling this scenario in your applications?
To be honest im starting to feel a little sceptical about serializing the whole notification as it seems php/laravel is unable to handle quite basic changes to the serialized Notification class. And since it's encoded it's a little difficult to query and migrate the failing notifications. It feels like we might be missing a piece of the puzzle though.

Kindly Fredrik

@atymic
Copy link
Collaborator

atymic commented Apr 17, 2024

It's been a while since we wrote the serialisation logic for this, but my understanding it works pretty much the same way as laravel jobs.

Basically just make only backward compatible changes, ie if you add a property, make it nullable, etc. The serialisation is basically the properties and their values (try to stick to basic types, or models which are re-queried from the db) and the class name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants