-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gql): inifite loop with circular references [] #383
Conversation
chrishelgert
commented
Oct 26, 2023
•
edited
Loading
edited
- Use the depth limit for GraphQL if no gqlParams have been provided, to prevent an endless loop of updates for circular references
- Drop VisitedReferencesMap and EntityReferenceMap in favor of the EditorEntityStore
- Move the store up on a higher level to be better accessible and increase update speed
- Move the depth handling the other way around, instead of increase the depth, decrease the remaining depth
- Additionally define a custom depth for rich text (only two levels instead of max 10)
cdf90d1
to
a7ec530
Compare
a7ec530
to
8e3daba
Compare
c6fe18f
to
f766be8
Compare
return maxDepth >= 0; | ||
} | ||
|
||
function getRichTextDepth(maxDepth: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Math.min(maxDepth - 1, MAX_RTE_DEPTH);
does this do the same?
f766be8
to
a73451d
Compare
depth: number, | ||
visitedReferenceMap: Map<string, Reference>, | ||
sendMessage: SendMessage | ||
maxDepth: number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why have you changed this from depth to maxDepth sorry I think I'm missing this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we can define a different maxDepth for RichText
it's easier in this one, as we otherwise would need to start with 8
for rich text and check for the limit of 10
@@ -9,6 +9,7 @@ export const TOOLTIP_HEIGHT = 32; | |||
export const TOOLTIP_PADDING_LEFT = 5; | |||
|
|||
export const MAX_DEPTH = 10; | |||
export const MAX_RTE_DEPTH = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we need 2 for rich text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 Level depth for the direct references
Assuming it's an entry it could be relevant to resolve also the asset of this entry, therefore then 2