This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Fix/global vpn peers#320
Merged
Merged
Conversation
There was a problem hiding this comment.
Hey @nxtcoder17 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Comment on lines
+4094
to
+4096
| case "GlobalVPNDevice.creationMethod": | ||
| if e.complexity.GlobalVPNDevice.CreationMethod == nil { | ||
| break |
There was a problem hiding this comment.
suggestion: Consistency in error handling for 'CreationMethod' when nil.
Consider returning a specific error when 'CreationMethod' is nil, similar to other cases in the switch statement, to enhance error tracking and handling.
Suggested change
| case "GlobalVPNDevice.creationMethod": | |
| if e.complexity.GlobalVPNDevice.CreationMethod == nil { | |
| break | |
| case "GlobalVPNDevice.creationMethod": | |
| if e.complexity.GlobalVPNDevice.CreationMethod == nil { | |
| return nil, fmt.Errorf("creation method is nil for GlobalVPNDevice") | |
| } |
Comment on lines
+27423
to
+27448
| func (ec *executionContext) _GlobalVPNDevice_creationMethod(ctx context.Context, field graphql.CollectedField, obj *entities.GlobalVPNDevice) (ret graphql.Marshaler) { | ||
| fc, err := ec.fieldContext_GlobalVPNDevice_creationMethod(ctx, field) | ||
| if err != nil { | ||
| return graphql.Null | ||
| } | ||
| ctx = graphql.WithFieldContext(ctx, fc) | ||
| defer func() { | ||
| if r := recover(); r != nil { | ||
| ec.Error(ctx, ec.Recover(ctx, r)) | ||
| ret = graphql.Null | ||
| } | ||
| }() | ||
| resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { | ||
| ctx = rctx // use context from middleware stack in children | ||
| return obj.CreationMethod, nil | ||
| }) | ||
| if err != nil { | ||
| ec.Error(ctx, err) | ||
| return graphql.Null | ||
| } | ||
| if resTmp == nil { | ||
| return graphql.Null | ||
| } | ||
| res := resTmp.(string) | ||
| fc.Result = res | ||
| return ec.marshalOString2string(ctx, field.Selections, res) |
There was a problem hiding this comment.
suggestion: Check for potential data type issues in '_GlobalVPNDevice_creationMethod'.
Ensure that the type assertion for 'resTmp' to 'string' is safe and consider handling possible assertion failures gracefully.
Suggested change
| func (ec *executionContext) _GlobalVPNDevice_creationMethod(ctx context.Context, field graphql.CollectedField, obj *entities.GlobalVPNDevice) (ret graphql.Marshaler) { | |
| fc, err := ec.fieldContext_GlobalVPNDevice_creationMethod(ctx, field) | |
| if err != nil { | |
| return graphql.Null | |
| } | |
| ctx = graphql.WithFieldContext(ctx, fc) | |
| defer func() { | |
| if r := recover(); r != nil { | |
| ec.Error(ctx, ec.Recover(ctx, r)) | |
| ret = graphql.Null | |
| } | |
| }() | |
| resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { | |
| ctx = rctx // use context from middleware stack in children | |
| return obj.CreationMethod, nil | |
| }) | |
| if err != nil { | |
| ec.Error(ctx, err) | |
| return graphql.Null | |
| } | |
| if resTmp == nil { | |
| return graphql.Null | |
| } | |
| res := resTmp.(string) | |
| fc.Result = res | |
| return ec.marshalOString2string(ctx, field.Selections, res) | |
| if resStr, ok := resTmp.(string); ok { | |
| res = resStr | |
| } else { | |
| ec.Error(ctx, fmt.Errorf("type assertion to string failed")) | |
| return graphql.Null | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.