-
-
Notifications
You must be signed in to change notification settings - Fork 916
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 counting of nested named fragments #3094
Conversation
9d03dc5
to
b1856e9
Compare
My only comment is that with the revised code, a recursive query will cause a stack overflow exception. Stack overflow exceptions cannot be caught by any .NET code and will cause an immediate restart of the application without any logging. However, recursive queries are not allowed according to spec, and are typically caught during the validation phase. Should we add any code to prevent recursively referenced fragments from crashing an app, or leave it as-is? If so, perhaps something as simple as As for performance, so long as there are no fragment references, there is no performance impact. And if there is, it is important that the fragments be counted properly. So the added code seems fine to me. The only alternative is to use a @sungam3r Would you like to comment also? |
I agree. One more thing I want to say - it is strange that such an obvious error remained unnoticed. In other places recursion is used when dealing with fragments, and here we just forgot.
I would not. As I said, in other places recursion is also used. Validation rules are intended to catch broken requests. Adding such checks here and there in code base will only complicate and pollute the code. |
@Shane32 merge if OK. |
Thanks for the contribution @cotillion !! |
Fixes #3093
It's possible there is a better way to do this but it seems to work. There might be some performance impact..