fix(lark_trigger): fix serialization error for bitable record changed#2843
fix(lark_trigger): fix serialization error for bitable record changed#2843Night-stars-1 wants to merge 2 commits intolanggenius:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Lark Bitable record change event to process before_value and after_value as structured lists of field IDs and values, and increments the manifest version. Feedback highlights a typo in the after_value logic and a schema inconsistency where the YAML definition uses object instead of array for the new list-based fields.
| for after_value_item in action.after_value: | ||
| after_value.append({ | ||
| "field_id": after_value_item.field_id if after_value_item.field_id else "", | ||
| "field_value": after_value_item.field_value if after_value_item.field_id else "" |
There was a problem hiding this comment.
There is a typo in the conditional check for field_value. It currently checks after_value_item.field_id instead of after_value_item.field_value. This makes the logic inconsistent with the before_value processing on line 54 and may result in None being assigned to field_value if the actual value is None but the field_id exists.
| "field_value": after_value_item.field_value if after_value_item.field_id else "" | |
| "field_value": after_value_item.field_value if after_value_item.field_value else "" |
Related Issues or Context
Fixed a PydanticSerializationError triggered when processing Bitable record change events.
The
before_valueandafter_valuefields contain instances ofBitableTableRecordActionField. Since this class does not inherit from Pydantic's BaseModel, it causes a serialization failure when the event data is handled by Pydantic-based componentsSolution:
Manually transform the
BitableTableRecordActionFieldobjects into standard dictionaries by extractingfield_idandfield_value. This ensures theaction_infoobject consists only of JSON-serializable Python primitives.This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
Before:

After:

This PR contains Changes to LLM Models Plugin
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)0.0.3→0.0.4Dify Plugin SDK Version
dify_plugin>=0.3.0,<0.6.0is in requirements.txt (SDK docs)Note: The current requirements.txt specifies dify_plugin>=0.5.0 which was already the case before this PR.
Environment Verification (If Any Code Changes)
Local Deployment Environment
SaaS Environment