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

ignore session answer attributes in the stored JSON that have not been defined on the SessionAnswers class #3038

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

alkesh
Copy link
Contributor

@alkesh alkesh commented Jul 29, 2024

Before this change, an UnknownAttributeError is raised on any page in the journey, hence breaking the app totally, in the following scenarios:

  • we've added an attribute to Journeys::SessionAnswers, deployed it, but then want to roll back that deployment
  • we want to remove an attribute from Journeys::SessionAnswers and deploy that
  • for a developer running locally, and having completed journeys locally, switching between branches that have added new attributes

There is a workaround that doesn't involve this change - and that is to purge all journey sessions.
This change would mean that is no longer necessary.

Copy link
Contributor

@rjlynch rjlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@@ -12,7 +12,10 @@ def cast_value(value)
rescue
nil
end
answers_class.new(decoded) unless decoded.nil?
unless decoded.nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

@alkesh alkesh marked this pull request as ready for review July 29, 2024 10:56
@alkesh alkesh force-pushed the ignore-undefined-session-answer-attributes branch from 7982f1a to 14f4073 Compare July 30, 2024 10:34
@alkesh alkesh force-pushed the ignore-undefined-session-answer-attributes branch from 14f4073 to a8121fe Compare July 30, 2024 11:16
@alkesh alkesh merged commit c307f6d into master Jul 30, 2024
14 checks passed
@alkesh alkesh deleted the ignore-undefined-session-answer-attributes branch July 30, 2024 13:19
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

Successfully merging this pull request may close these issues.

3 participants