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

fix error and update example #74

Merged
merged 1 commit into from
Mar 1, 2023
Merged

fix error and update example #74

merged 1 commit into from
Mar 1, 2023

Conversation

Afronut
Copy link
Contributor

@Afronut Afronut commented Feb 25, 2023

  • in database_handler.cpp the boost optional value expiryDate will not be initialized on idTag if experyDate is not provided or tag does not have such a date. However, in the chargepoint->validate_against_cache_entries, value() is called on the returned idtag (a boost optional ) from get_authorization_cache_entry. This will always throw.
  • Update the chargepoint example because parameters of he function on_session_started and on_session_stopped has changed

@Afronut
Copy link
Contributor Author

Afronut commented Feb 25, 2023

boost reference

Copy link
Contributor

@Pietfried Pietfried left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes to the build examples.

Please remove the changes to the database_handler.cpp and then we can merge.

@@ -323,6 +323,11 @@ boost::optional<v16::IdTagInfo> DatabaseHandler::get_authorization_cache_entry(c
const auto expiry_date = DateTime(expiry_date_str);
id_tag_info.expiryDate.emplace(expiry_date);
}
// if expiry date is not set, calling has_value() on the returned optional will return true, but calling value()
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling has_value() on an boost:optional will return false if the value of the optional is not set, so setting id_tag_info.expiryDate = boost::none is not necessary

@Afronut
Copy link
Contributor Author

Afronut commented Feb 27, 2023

I will remove it however the client crash when local whitelist is enabled and the server send tags with no expiration so store locally. I have tried with Steve server
I can create a issue.

@Pietfried
Copy link
Contributor

I will remove it however the client crash when local whitelist is enabled and the server send tags with no expiration so store locally. I have tried with Steve server I can create a issue.

Ok, I tried to reproduce it but could not get the same result. Please create a ticket with further information of your general setup / config file etc. so that we can try to reproduce the error.

@Afronut
Copy link
Contributor Author

Afronut commented Mar 1, 2023

I have removed the update to database handler

Signed-off-by: Coovi Meha <[email protected]>
Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried merged commit 54e2e97 into EVerest:main Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants