Repository navigation
fix(models): accept unknown view state value keys - #2042
Merged
Merged
Conversation
ViewStateValue had no **kwargs, so any state value key it does not model (selected_date_time, timezone, rich_text_value, files) raised TypeError, and View(**view_payload) crashed on modals with a datetimepicker, rich_text_input, or file_input. Unknown keys now land in additional_attributes, as View already does. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Harness. |
WilliamBergamin
marked this pull request as ready for review
November 16, 2026 16:54
zimeg
approved these changes
Nov 16, 2026
zimeg
left a comment
Member
There was a problem hiding this comment.
✅ 🐍 @WilliamBergamin LGTM! Thanks for keeping view payloads loadable.
mwbrooks
approved these changes
Nov 16, 2026
mwbrooks
left a comment
Member
There was a problem hiding this comment.
✅ Thanks @WilliamBergamin! Datetimepicker and file_input modals load again instead of hitting a TypeError, nice fix.
Merged
6 of 16 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.
Summary
This pull request lets
ViewStateValueaccept state value keys it does not model, soView(**view_payload)stops crashing on modern modals.ViewStateValue.__init__had no**kwargs, soselected_date_time,timezone,rich_text_value, andfilesraisedTypeError. Any view payload with a datetimepicker, a timepicker with a timezone, a rich_text_input, or a file_input could not be loaded.additional_attributes, asViewalready does.attributesis unchanged, soto_dict()drops them (the Java SDK's Gson model drops them the same way).Testing
The new tests fail on
mainwithTypeErrorand pass on this branch:ViewStateValue(type="datetimepicker", selected_date_time=1700000000)constructs and keeps the key inadditional_attributes.View(type="modal", ..., state={...datetimepicker value...})constructs.Category
/docs(Documents)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements
🤖 Generated with Claude Code