-
Notifications
You must be signed in to change notification settings - Fork 46
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
Sd mismatch issue, make Sd value to lower case in dbOperation() #46
Conversation
@@ -1358,6 +1358,42 @@ func dbOperation(ueId string, servingPlmnId string, method string, subsData *Sub | |||
filterUeIdOnly := bson.M{"ueId": ueId} | |||
filter := bson.M{"ueId": ueId, "servingPlmnId": servingPlmnId} | |||
|
|||
// Set Sd value to lower case | |||
if subsData != nil { |
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.
if subsData == nil {
return
}
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.
It couldn't be returned because the function DeleteSubscriberByID() should call dbOperation() with argument subsData = nil .
backend/WebUI/api_webui.go
Outdated
// Set Sd value to lower case | ||
if subsData != nil { | ||
if subsData.AccessAndMobilitySubscriptionData.Nssai != nil { | ||
if subsData.AccessAndMobilitySubscriptionData.Nssai.DefaultSingleNssais != nil { |
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.
remove this if, range will skip it if it is nil
backend/WebUI/api_webui.go
Outdated
subsData.AccessAndMobilitySubscriptionData.Nssai.DefaultSingleNssais[i].Sd = strings.ToLower(defaultSingleNssai.Sd) | ||
} | ||
} | ||
if subsData.AccessAndMobilitySubscriptionData.Nssai.SingleNssais != nil { |
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.
remove this if, range will skip it if it is nil
backend/WebUI/api_webui.go
Outdated
} | ||
} | ||
} | ||
if subsData.SessionManagementSubscriptionData != nil { |
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.
remove this if, range will skip it if it is nil
backend/WebUI/api_webui.go
Outdated
subsData.SessionManagementSubscriptionData[i].SingleNssai.Sd = strings.ToLower(subscriptionData.SingleNssai.Sd) | ||
} | ||
} | ||
if subsData.SmfSelectionSubscriptionData.SubscribedSnssaiInfos != nil { |
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.
remove this if, range will skip it if it is nil
backend/WebUI/api_webui.go
Outdated
} | ||
} | ||
} | ||
if subsData.SmPolicyData.SmPolicySnssaiData != nil { |
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.
remove this if, range will skip it if it is nil
backend/WebUI/api_webui.go
Outdated
if subsData != nil { | ||
if subsData.AccessAndMobilitySubscriptionData.Nssai != nil { | ||
if subsData.AccessAndMobilitySubscriptionData.Nssai.DefaultSingleNssais != nil { | ||
for i, defaultSingleNssai := range subsData.AccessAndMobilitySubscriptionData.Nssai.DefaultSingleNssais { |
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.
use local var to short whole codes:
defaultSingleNssais := subsData.AccessAndMobilitySubscriptionData.Nssai.DefaultSingleNssais
for i, defaultSingleNssai := range defaultSingleNssais {
defaultSingleNssais[i].Sd = strings.ToLower(defaultSingleNssai.Sd)
}
also modify codes below.
backend/WebUI/api_webui.go
Outdated
} | ||
|
||
smPolicySnssaiDatas := subsData.SmPolicyData.SmPolicySnssaiData | ||
for i, snssaiData := range smPolicySnssaiDatas { |
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.
for i := range smPolicySnssaiDatas {
smPolicySnssaiDatas[i].Snssai.Sd = strings.ToLower(smPolicySnssaiDatas[i].Snssai.Sd)
}
This PR is to fix github issue #435