Skip to content

[MOB-15980] Fixed getTrackingIdentifier and getVisitorIdentifier to return nil string and not return unexpected error when aid vid values are not found.#62

Merged
emdobrin merged 6 commits intoadobe:dev-v3.0.4from
addb:MOB-15980
Mar 16, 2022
Merged

[MOB-15980] Fixed getTrackingIdentifier and getVisitorIdentifier to return nil string and not return unexpected error when aid vid values are not found.#62
emdobrin merged 6 commits intoadobe:dev-v3.0.4from
addb:MOB-15980

Conversation

@addb
Copy link
Copy Markdown
Collaborator

@addb addb commented Mar 9, 2022

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.

…eturn nil string and not return unexpected error when aid vid values are not found.
@addb addb requested review from emdobrin and kevinlind March 9, 2022 00:08
@addb addb changed the base branch from main to dev-v3.0.4 March 9, 2022 00:08
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2022

Codecov Report

Merging #62 (1167d19) into dev-v3.0.4 (1a14741) will increase coverage by 34.29%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           dev-v3.0.4      #62       +/-   ##
===============================================
+ Coverage       55.92%   90.21%   +34.29%     
===============================================
  Files              14       14               
  Lines            1107     1113        +6     
===============================================
+ Hits              619     1004      +385     
+ Misses            488      109      -379     

@emdobrin
Copy link
Copy Markdown
Contributor

I am considering an alternative solution, to modify getSharedState to include empty values when aid/vid are not available, so the shared state and response identity event shares the keys verbosely like:

Standard shared state created for com.adobe.module.analytics with version x and data: 
{
  "aid" : "",
  "vid" : ""
}

This option is also in line with Android and ACP versions. @kevinlind @addb thoughts?

@kevinlind
Copy link
Copy Markdown
Contributor

kevinlind commented Mar 14, 2022

I am considering an alternative solution, to modify getSharedState to include empty values when aid/vid are not available, so the shared state and response identity event shares the keys verbosely like:

Standard shared state created for com.adobe.module.analytics with version x and data: 
{
  "aid" : "",
  "vid" : ""
}

This option is also in line with Android and ACP versions. @kevinlind @addb thoughts?

Honestly, I prefer to filter out null/empty values from the EventData. I think the Swift implementation actually corrects the C++ implementation, so I'd like to leave the shared state as it is.
If anything, I would suggest, in IdentityProperties, to set aid/vid to nil if the setter's are passed an empty string. It appears the current implementation could return either nil or empty string to the public API.

@addb
Copy link
Copy Markdown
Collaborator Author

addb commented Mar 14, 2022

I am considering an alternative solution, to modify getSharedState to include empty values when aid/vid are not available, so the shared state and response identity event shares the keys verbosely like:

Standard shared state created for com.adobe.module.analytics with version x and data: 
{
  "aid" : "",
  "vid" : ""
}

This option is also in line with Android and ACP versions. @kevinlind @addb thoughts?

Honestly, I prefer to filter out null/empty values from the EventData. I think the Swift implementation actually corrects the C++ implementation, so I'd like to leave the shared state as it is. If anything, I would suggest, in IdentityProperties, to set aid/vid to nil if the setter's are passed an empty string. It appears the current implementation could return either nil or empty string to the public API.

I am also of the opinion to not share empty values and instead have nil.

@emdobrin
Copy link
Copy Markdown
Contributor

Sounds good, let's make sure the shared state/response event docs are up to date too.
Left some small comments on the logic.

Copy link
Copy Markdown
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.

Looks good with a small suggestion

@emdobrin emdobrin merged commit 6047212 into adobe:dev-v3.0.4 Mar 16, 2022
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.

3 participants