Skip to content

Persist StateStore#189

Merged
addb merged 4 commits intoadobe:consentfrom
addb:persistStateStore
Aug 26, 2024
Merged

Persist StateStore#189
addb merged 4 commits intoadobe:consentfrom
addb:persistStateStore

Conversation

@addb
Copy link
Copy Markdown
Contributor

@addb addb commented Aug 24, 2024

Description

  • Removed Timer and StateStoreEntry ad simplified the logic

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@addb addb linked an issue Aug 24, 2024 that may be closed by this pull request
Copy link
Copy Markdown

@kevinlind kevinlind left a comment

Choose a reason for hiding this comment

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

Looks good. One minor comment, for the positive test cases where the state store does not expire, you could consider increasing the timeout to avoid false test failures on slow CI systems.

value: "or2",
maxAge: 1800
},
"expiryTs": _adb_timestampInMillis() + 1000
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: Consider making the timeout larger than 1 second in case of slow CI systems to avoid false negative. Maybe set it to 3 or 5 seconds?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These tests don't run on CI as there is no roku device support.

Copy link
Copy Markdown

@praveek praveek left a comment

Choose a reason for hiding this comment

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

Query around max age when persisting states

maxAgeSeconds = payload.maxAge
if not _adb_isPositiveWholeNumber(maxAgeSeconds)
_adb_logDebug("_adb_StateStore::_setExpiryTime() - Invalid payload.maxAge value:(" + FormatJson(maxAgeSeconds) + "), using 0 as default value.")
maxAgeSeconds = 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there a default max age? You can remove the entry instead of setting its age to 0, as it will simply expire during the next call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@praveek Updated the logic to explicitly delete the entry.

@addb addb requested a review from praveek August 26, 2024 22:31
@addb addb merged commit d75d8ca into adobe:consent Aug 26, 2024
@addb addb deleted the persistStateStore branch September 5, 2024 21:35
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.

Persist State:Store and LocationHint

3 participants