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

feat: Hash keys for idCache #833

Conversation

rmi22186
Copy link
Member

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

Hash the concatenated identities.

Testing Plan

  • Was this tested locally? If not, explain why.
  • {explain how this has been tested, and what, if any, additional testing should be done}
    Unit tests

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

@@ -62,7 +63,7 @@ export const cacheIdentityRequest = (
const cache: Dictionary<ICachedIdentityCall> = idCache.retrieve() || ({} as Dictionary<ICachedIdentityCall>);
const cacheKey = concatenateIdentities(method, identities);

cache[cacheKey] = { responseText: xhr.responseText, status: xhr.status, expireTimestamp};
cache[generateHash(cacheKey)] = { responseText: xhr.responseText, status: xhr.status, expireTimestamp};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be split into two lines for readability.

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@rmi22186 rmi22186 merged commit 546235e into feat/SQDSDKS-5976-identity-caching-feature-branch Jan 23, 2024
25 of 28 checks passed
@rmi22186 rmi22186 mentioned this pull request Jan 23, 2024
1 task
@rmi22186 rmi22186 deleted the feat/SQDSDKS-6089-hash-idcache-keys branch April 8, 2024 14:31
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