Fix JSONDecodeError in link filters#261
Conversation
- Updated `link_filters` in `flexirule/ruleflow/core/contracts.py` to use double quotes for internal strings, ensuring they are valid JSON. - Enhanced frontend filter sanitization in `control_registry.js`, `ActionSettings.vue`, and `useMetaStore.js` to handle malformed strings and prevent them from being sent to the backend. - Added fallbacks to empty objects for failed JSON parsing in filter extraction logic.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR fixes a
JSONDecodeErrorthat occurred in the backend when processinglink_filters. The root cause was the use of single quotes in JSON strings within thecontracts.pyfile, which is invalid according to JSON standards.Key changes:
link_filtersinflexirule/ruleflow/core/contracts.pyto use escaped double quotes.flexirule/public/js/flexirule/core/control_registry.jsto fallback to an empty object ifJSON.parsefails.flexirule/public/js/flexirule/rule_builder/components/rule_config/ActionSettings.vueto sanitizelink_filtersbefore returning them.flexirule/public/js/flexirule/rule_builder/stores/useMetaStore.jsto sanitize filters before making thefrappe.desk.search.search_linkcall.pre-commit run --allto ensure code quality and consistency.PR created automatically by Jules for task 17439329735015731471 started by @ruzaqiarkan-eng