Skip to content

[MOB-22477] - Added support for debug events and separate cache for Preview Propositions#120

Merged
akhiljain1907 merged 5 commits intoadobe:dev-v5.2.0from
akhiljain1907:fix/preview
Nov 28, 2024
Merged

[MOB-22477] - Added support for debug events and separate cache for Preview Propositions#120
akhiljain1907 merged 5 commits intoadobe:dev-v5.2.0from
akhiljain1907:fix/preview

Conversation

@akhiljain1907
Copy link
Copy Markdown
Contributor

In this PR we've added a separate preview cache and modified handling of get proposition to provide requested data from preview cache if present.

Description

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.

…on to provide requested data from preview cache if present.
XCTAssertEqual("com.adobe.eventSource.notification", dispatchedEvent?.source)

XCTAssertEqual(1, optimize.previewCachedPropositions.count)
XCTAssertTrue(optimize.cachedPropositions.isEmpty)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we check the previewed response is returned here when both Optimize.getPropositions and Optimize.onPropositionsUpdate are called?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also add a test case for

  1. Debug Event received for decisionScopeA -> Optimize.getPropositions(decisionScopeA, decisionScopeB) and check the response we receive for both scopes
  2. Debug event received for decisionScopeA -> Optimize.updatePropositions(decisionScopeA, decisionScopeB) -> Optimize.getPropositions(decisionScopeA, decisionScopeB) and check the response we receive for both scopes

Copy link
Copy Markdown
Contributor Author

@akhiljain1907 akhiljain1907 Nov 26, 2024

Choose a reason for hiding this comment

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

Done. i have added test cases where we receive debug events for a scope and check for get calls for multiple scope and also update and get for multiple scopes.

Copy link
Copy Markdown
Contributor

@spoorthipujariadobe spoorthipujariadobe left a comment

Choose a reason for hiding this comment

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

nit: Can we check previewCachedPropositions is empty in testClearCachedPropositions

@akhiljain1907 akhiljain1907 changed the title [MOB-22477] - Added Separate cache for Preview Propositions [MOB-22477] - Added support for debug events and separate cache for Preview Propositions Nov 27, 2024
@akhiljain1907 akhiljain1907 changed the base branch from main to dev-v5.2.0 November 28, 2024 12:30
@akhiljain1907 akhiljain1907 merged commit 20f0644 into adobe:dev-v5.2.0 Nov 28, 2024
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