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

Cache configuration with Edge hit (resolves #367) #458

Merged
merged 17 commits into from
Apr 26, 2024

Conversation

kevinlind
Copy link
Collaborator

Description

Cache the Edge configuration with the queued data entity instead of retrieving the configuration when the hit is processed. This update preserves the previous EdgeHitProcessor workflow to handle cases where queued data entities without a configuration are present after upgrading to this newer version.

  • Edge extension will now bundle the edge configuration in the EdgeDataEntity when adding entity to queue.
  • EdgeHitProcessor now reads the edge configuration from the EdgeDataEntity instead of getting it from the current Configuration shared state.
  • EdgeHitProcess continues to use old workflow of validating against readyForEvent and reading the Configuration shared state if the current data entity contains an empty configuration.

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.

@kevinlind kevinlind linked an issue Apr 17, 2024 that may be closed by this pull request
Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift Outdated Show resolved Hide resolved
Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift Outdated Show resolved Hide resolved
Sources/Edge.swift Outdated Show resolved Hide resolved
Sources/Edge.swift Outdated Show resolved Hide resolved
@kevinlind kevinlind requested a review from emdobrin April 22, 2024 19:14
Sources/Edge.swift Outdated Show resolved Hide resolved
Tests/UnitTests/EdgeHitProcessorTests.swift Outdated Show resolved Hide resolved
Tests/UnitTests/EdgeExtensionTests.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

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

minor comment on docs, looks good


/// Get the Edge configuration by quering the Configuration shared state and filtering out only the key needed for Edge requests.
/// - Parameter event: the `Event` to get the configuration
/// - Returns: A dictionary of Edge configuration values, or nil if the Configuration shared state could not be retrieved or if the `edge.configId` key is missing or empty.
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't seem to return nil 🤓

@kevinlind kevinlind merged commit 3c04830 into adobe:dev Apr 26, 2024
6 checks passed
@kevinlind kevinlind deleted the cache-config branch April 26, 2024 05:42
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.

Cache config with Edge event
3 participants