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

getSharedState() will not return the latest if the given event is nil #563

Closed
yangyansong-adbe opened this issue Mar 4, 2021 · 2 comments · Fixed by #564
Closed

getSharedState() will not return the latest if the given event is nil #563

yangyansong-adbe opened this issue Mar 4, 2021 · 2 comments · Fixed by #564
Assignees
Labels
bug Something isn't working. Used by issue templates coresquad

Comments

@yangyansong-adbe
Copy link
Contributor

Expected Behaviour

    /// Retrieves the `SharedState` for a specific extension
    /// - Parameters:
    ///   - extensionName: An extension name whose `SharedState` will be returned
    ///   - event: If not nil, will retrieve the `SharedState` that corresponds with this event's version. If nil will return the latest `SharedState`
    ///   - barrier: If true, the `EventHub` will only return `.set` if `extensionName` has moved past `event`
    ///   - sharedStateType: The type of shared state to be read from, if not provided defaults to `.standard`
    /// - Returns: The `SharedState` data and status for the extension with `extensionName`

From the above public API doc, getSharedState() should return the latest SharedState if the given even is nil.

Actual Behaviour

let result = sharedState.resolve(version: version)

SharedState.resolve() will return the oldest one if the event version is 0.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

@yangyansong-adbe yangyansong-adbe added bug Something isn't working. Used by issue templates coresquad labels Mar 4, 2021
@yangyansong-adbe yangyansong-adbe self-assigned this Mar 4, 2021
@nporter-adbe
Copy link
Contributor

Are we sure we want to make this change and not update the doc comment?
#299

@nporter-adbe
Copy link
Contributor

Talked with @shalehaha the current implementation is desired, however, somehow the doc comment got out of sync. To resolve this issue I think we just need to update the doc comment.

https://github.com/adobe/aepsdk-core-ios/pull/299/files#diff-02bd1581c751b39213c003d305212478496f8a5290a1a877cef358a338c892f4R187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. Used by issue templates coresquad
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants