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

Remove from PolicyManagerImpl "if (!snapshot_)", "if (!storage_)", "if (!pt_)", "if (!GetPermissionsList(list_of_permissions))" because it is code does not running #2477

Closed
HSavynetska opened this issue Jul 31, 2018 · 3 comments
Labels

Comments

@HSavynetska
Copy link

Bug Report

Remove from PolicyManagerImpl "if (!snapshot_)", "if (!storage_)", "if (!pt_)", "if (!GetPermissionsList(list_of_permissions))" because it is code does not running

Description:

PolicyManagerImpl::CheckSnapshotInitialization()
Need removed "if (!snapshot_)" check because snapshot pointer inits just
before this function call, in GenerateSnapshot() function and this
is only place where this function called.

PolicyManagerImpl::PersistData()
Need removed "if (!storage_)" check because this function calls only from
BackgroundBackuper which starts only by ctor. And storage_ is always
inited in ctor.
Need removed "if (!pt_)" check because pt_ will be always inited in ctor
and cannot be replaced with null pointer through public interface.

PolicyManagerImpl::GetDeviceConsent()
Need removed "if (!GetPermissionsList(list_of_permissions))" check because
this function always return true, because pt_ will always be inited.
Therefore checking result of this function is not necessary.

OS & Version Information
  • OS/Version:
  • SDL Core Version:
  • Testing Against:
@iCollin
Copy link
Collaborator

iCollin commented Oct 1, 2020

@HSavynetska Hello, PR #3453 notes that it fixes this issue but I do not see all these removals in the diff for that PR. Can you confirm whether or not this issue was fixed with the merge of #3453?

@theresalech theresalech added the Waiting for Feedback Maintainers are waiting for feedback from an author or contributor label Oct 1, 2020
@ychernysheva
Copy link
Contributor

Hello @iCollin I've investigated this issue during work on #3453. This issue is old and mostly outdated, because now we don't have mentioned methods on current develop branch, except method CheckSnapshotInitialization(), which probably was moved in the past from PolicyManagerImpl class to CacheManager class. In fact this check is redundant, that's why I deleted it in 9b65b06#diff-364146db2d1780b4286234cb8c7db37dL1843

@iCollin
Copy link
Collaborator

iCollin commented Oct 2, 2020

@ychernysheva Thank you for the info. I will consider this issue fixed by #3453.

@iCollin iCollin closed this as completed Oct 2, 2020
@theresalech theresalech removed the Waiting for Feedback Maintainers are waiting for feedback from an author or contributor label Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants