-
Notifications
You must be signed in to change notification settings - Fork 12
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
project init #1
project init #1
Conversation
self.updateAttributes(event) | ||
} else if event.isGetAttributesEvent { | ||
self.getAttributes(event) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log a trace message if the event doesn't match either of the check
public func onUnregistered() {} | ||
|
||
public func readyForEvent(_ event: Event) -> Bool { | ||
return getSharedState(extensionName: UserProfileConstants.Configuration.NAME, event: event)?.status == .set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need configuration shared state. Are we doing this check in v5?
/// - Parameter event: the RulesEngine response event | ||
private func handleRulesEngineResponse(event: Event) { | ||
guard event.isRulesConsequenceEvent, event.consequenceType == UserProfileConstants.RulesEngine.CONSEQUENCE_KEY_CSP else { | ||
Log.debug(label: UserProfile.LOG_TAG, "Unable to process this event: not a RulesEngine response event for UserProfile extension") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need this log, or make it a trace log.
/// - Parameter event: the request event | ||
private func updateAttributes(_ event: Event) { | ||
guard let newAttributes = event.data?[UserProfileConstants.UserProfile.EventDataKeys.UPDATE_DATA_KEY] as? [String: Any], !newAttributes.isEmpty else { | ||
Log.debug(label: UserProfile.LOG_TAG, "Unable to process the update attributes event: not found valid event data") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to process the update attributes event: invalid event data
private func getAttributes(_ event: Event) { | ||
guard let keys = event.data?[UserProfileConstants.UserProfile.EventDataKeys.GET_DATA_ATTRIBUTES] as? [String], !keys.isEmpty else { | ||
Log.debug(label: UserProfile.LOG_TAG, "Unable to process the get attributes event: not found valid event data") | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also dispatch a respsone event here, to invoke the one time listener
attributes.removeValue(forKey: key) | ||
} | ||
guard attributesCount != attributes.count else { | ||
Log.debug(label: UserProfile.LOG_TAG, "Unable to process the remove attributes event: not found attributes for given keys - \(keys)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to process the remove attributes event: no attributes matched with the given keys - (keys)
/// - Parameter event: the request event | ||
private func getAttributes(_ event: Event) { | ||
guard let keys = event.data?[UserProfileConstants.UserProfile.EventDataKeys.GET_DATA_ATTRIBUTES] as? [String], !keys.isEmpty else { | ||
Log.debug(label: UserProfile.LOG_TAG, "Unable to process the get attributes event: not found valid event data") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid event data
/// - Parameter event: the request event | ||
private func removeAttributes(event: Event) { | ||
guard let keys = event.data?[UserProfileConstants.UserProfile.EventDataKeys.REMOVE_DATA_KEYS] as? [String], !keys.isEmpty else { | ||
Log.debug(label: UserProfile.LOG_TAG, "Unable to process the remove attributes event: not found valid event data") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to process the update attributes event: invalid event data
/// - Parameters: | ||
/// - attributeName: the attribute's key | ||
/// - attributeValue: the attribute's value | ||
static func updateUserAttribute(attributeName: String, attributeValue: String?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm wondering whether we need this API and the removeUserAttribute
API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can remove those 2 APIs, and only make them available in the Objective-C compatibility layer.
* commit '2ed7547ef954b343639806b73e3a2d7099d241e7': Update .swiftformat setup E2E (manual) testings target (adobe#17) Update README.md Update README.md Update readme.md (adobe#16) Update codecov.yml Update swift.yml (adobe#15) Response to review feedback (adobe#14) fix spm instructions Update README.md Update README.md add docs (adobe#13) review feedback WIP: project init (#1)
* commit '2ed7547ef954b343639806b73e3a2d7099d241e7': Update .swiftformat setup E2E (manual) testings target (#17) Update README.md Update README.md Update readme.md (#16) Update codecov.yml Update swift.yml (#15) Response to review feedback (#14) fix spm instructions Update README.md Update README.md add docs (#13) review feedback WIP: project init (#1)
No description provided.