Skip to content

Fix JSONDecodeError in link filters#261

Open
ruzaqiarkan-eng wants to merge 1 commit into
developfrom
fix-json-decode-error-in-filters-17439329735015731471
Open

Fix JSONDecodeError in link filters#261
ruzaqiarkan-eng wants to merge 1 commit into
developfrom
fix-json-decode-error-in-filters-17439329735015731471

Conversation

@ruzaqiarkan-eng

Copy link
Copy Markdown
Collaborator

This PR fixes a JSONDecodeError that occurred in the backend when processing link_filters. The root cause was the use of single quotes in JSON strings within the contracts.py file, which is invalid according to JSON standards.

Key changes:

  1. Data Correction: Converted all single-quoted link_filters in flexirule/ruleflow/core/contracts.py to use escaped double quotes.
  2. Frontend Robustness:
    • Updated flexirule/public/js/flexirule/core/control_registry.js to fallback to an empty object if JSON.parse fails.
    • Updated flexirule/public/js/flexirule/rule_builder/components/rule_config/ActionSettings.vue to sanitize link_filters before returning them.
    • Updated flexirule/public/js/flexirule/rule_builder/stores/useMetaStore.js to sanitize filters before making the frappe.desk.search.search_link call.
  3. Linting: Ran pre-commit run --all to ensure code quality and consistency.

PR created automatically by Jules for task 17439329735015731471 started by @ruzaqiarkan-eng

- 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.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Base automatically changed from refactor-contracts to develop July 4, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant