Skip to content
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

Add SessionIndex to LogoutRequest if it's available #38

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

mgyongyosi
Copy link

Add SessionIndex to LogoutRequest if it's available.

@mgyongyosi mgyongyosi added the enhancement New feature or request label Sep 13, 2024
Copy link

@linoman linoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 nit

Great job!

Comment on lines +1213 to +1215
if sessionIndex != "" {
req.SessionIndex = &SessionIndex{sessionIndex}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of the conditional statement? Can we get the same results if req.SessionIndex is nil vs ""?

Suggested change
if sessionIndex != "" {
req.SessionIndex = &SessionIndex{sessionIndex}
}
req.SessionIndex = &SessionIndex{sessionIndex}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I enclosed it in the if statement, because req.SessionIndex is a pointer and if that's nil then the xml marshaller skips the field. If I would instantiate SessionIndex regardless of the sessionIndex value then the SessionIndex would be marshalled to xml with an empty value in case of empty sessionIndex and that would change the current behaviour.

@mgyongyosi mgyongyosi merged commit ae3bbda into main Sep 17, 2024
6 checks passed
@mgyongyosi mgyongyosi deleted the set-sessionindex-on-logoutrequest branch September 17, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants