Repository navigation
fix(models): skip unknown view state values instead of crashing - #2043
Merged
Merged
Conversation
ViewState copied each block's actions before parsing them, so values it warned about and meant to skip stayed in place and crashed to_dict(). Its non-dict block branch warned with a leftover loop variable, raising UnboundLocalError or naming the wrong value. 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@@ Coverage Diff @@
## main #2043 +/- ##
==========================================
+ Coverage 84.40% 84.47% +0.07%
==========================================
Files 118 118
Lines 14035 14035
==========================================
+ Hits 11846 11856 +10
+ Misses 2189 2179 -10 ☔ View full report in Codecov by Harness. |
WilliamBergamin
marked this pull request as ready for review
November 16, 2026 17:02
zimeg
approved these changes
Nov 16, 2026
zimeg
left a comment
Member
There was a problem hiding this comment.
🐍 @WilliamBergamin LGTM! Thanks for making the skip actually skip.
mwbrooks
approved these changes
Nov 16, 2026
mwbrooks
left a comment
Member
There was a problem hiding this comment.
✅ Appreciate this one @WilliamBergamin, the tests that fail on main make both crashes easy to see.
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 makes
ViewStateactually skip the unknown state values it already warns about.to_dict()then raisedAttributeErrorcalling.to_dict()on it. Now the parsed actions start from{}, asOption.parse_alldoes. The now-unusedtype: ignoregoes with it.v. As the first block, that raisedUnboundLocalError; after another block, it named the wrong value. Now it warns withactions.ViewStates. Those values could never be serialized, and the warning already promised a skip. The legacyslackpackage re-exportsslack_sdk.models.views, so it gets the fix too.Testing
The new tests fail on
mainand pass on this branch:intaction value is skipped with a warning namingbuiltins.int, andto_dict()keeps the valid sibling.builtins.str, not the previous action's value; a non-dict first block no longer raises.Category
/docs(Documents)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements
🤖 Generated with Claude Code