drawdb icon indicating copy to clipboard operation
drawdb copied to clipboard

Add circular type dependency detection

Open Ishank307 opened this issue 2 months ago • 2 comments

Description

Adds validation to detect circular dependencies in custom types and shows proper error messages in the issues panel.

Problem

When users create custom types that reference each other (e.g., type_1 has a field of type_2, and type_2 has a field of type_1), no error was shown. This could lead to invalid type structures.

Solution

  • Added checkCircularTypes function to detect type reference loops
  • Added proper translation keys for the error message
  • Shows clear error: "Circular type dependency involving type 'X'"

How to Test

  1. Go to Types tab in sidebar
  2. Create type_1 with a field of type type_2
  3. Create type_2 with a field of type type_1
  4. Check Issues panel - should show circular dependency error

Type of Change

  • [x] Bug fix (adds missing validation)
  • [x] Enhancement (improves user experience)

Fixes missing validation for circular type references.

FIxes Show error for circular type references #615

Ishank307 avatar Oct 05 '25 05:10 Ishank307