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

STCOR-846 update session data with values from _self request #1466

Merged
merged 4 commits into from
May 29, 2024
Merged

Conversation

zburke
Copy link
Member

@zburke zburke commented May 9, 2024

When restoring an existing session, i.e. pulling session values from storage and merging them with results from the response to the _self request, allow the _self values to overwrite the others, including updates to the user and permissions objects. This allows name and permission changes to take effect immediately, simply by reloading, rather than requiring a sign-out/sign-in cycle.

There are two main aspects to this change:

  • A bug fix: previously, the _self request omitted the expandPermissions=true param that is necessary to retrieve the expanded and flattened permissions, instead returning only those values that are directly assigned.
  • User and permissions values from the _self response now overwrite those from the existing session in storage.

Additionally, the tokenExpiration value from the existing session is used as-is. Previously, it was overwritten with dummy values with the explanation that "the response from _self doesn't contain these values" ... but that's fine. The fact that the request to _self succeeded tells us the tokens are valid and therefore that the values in the existing session are valid.

Refs STCOR-846

When restoring an existing session, i.e. pulling session values from
storage and merging them with results from the response to the `_self`
request, allow the `_self` values to overwrite the others, including
updates to the `user` and `permissions` objects. This allows name and
permission changes to take effect immediately, simply by reloading,
rather than requiring a sign-out/sign-in cycle.

There are two main aspects to this change:
* A bug fix: previously, the `_self` request omitted the
  `expandPermissions=true` param that is necessary to retrieve
  the expanded and flattened permissions, instead returning only those
  values that are directly assigned.
* User and permissions values from the `_self` response now overwrite
  those from the existing session in storage.

Additionally, the `tokenExpiration` value from the existing session is
used as-is. Previously, it was overwritten with dummy values with the
explanation that "the response from _self doesn't contain these values"
... but that's fine. The fact that the request to `_self` succeeded
tells us the tokens are valid and therefore that the values in the
existing session are valid.

Refs STCOR-846
Copy link

github-actions bot commented May 9, 2024

Jest Unit Test Statistics

208 tests  +1   208 ✔️ +1   50s ⏱️ +4s
  31 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit b5be7a0. ± Comparison against base commit 2b86b9e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 9, 2024

BigTest Unit Test Statistics

    1 files  ±0      1 suites  ±0   11s ⏱️ ±0s
270 tests ±0  264 ✔️ ±0  6 💤 ±0  0 ±0 
273 runs  ±0  267 ✔️ ±0  6 💤 ±0  0 ±0 

Results for commit b5be7a0. ± Comparison against base commit 2b86b9e.

This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
      equal to check email label in english translation
      equal to check email precautions label in english translation
      equal to sent email precautions label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username form test check email status page tests ‑ Forgot username form test check email status page tests should have the header with an appropriate text content
Chrome_125_0_0_0_(Linux_x86_64).Forgot username form test check email status page tests ‑ Forgot username form test check email status page tests should have the paragraph with an appropriate text content
Chrome_125_0_0_0_(Linux_x86_64).Forgot username form test check email status page tests ‑ Forgot username form test check email status page tests should have the header with an appropriate text content
      equal to check email label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username form test check email status page tests ‑ Forgot username form test check email status page tests should have the paragraph with an appropriate text content
      equal to check email precautions label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username form test check email status page tests ‑ Forgot username form test check email status page tests should have the paragraph with an appropriate text content
      equal to sent email precautions label in english translation

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 29, 2024

Jest Unit Test Results

226 tests  +1   226 ✅ +1   46s ⏱️ -1s
 35 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 6d90bee. ± Comparison against base commit 80bda77.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 29, 2024

Bigtest Unit Test Results

193 tests  ±0   188 ✅ ±0   6s ⏱️ ±0s
  1 suites ±0     5 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 6d90bee. ± Comparison against base commit 80bda77.

This pull request removes 5 and adds 3 tests. Note that renamed tests count towards both.
      equal to check email label in english translation
      equal to check email precautions label in english translation
      equal to sent email precautions label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the header with an appropriate text content
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the header with an appropriate text content
      equal to check email label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
      equal to check email precautions label in english translation
Chrome_125_0_0_0_(Linux_x86_64).Forgot username/password status test check email status page tests ‑ Forgot username/password status test check email status page tests should have the paragraph with an appropriate text content
      equal to sent email precautions label in english translation

♻️ This comment has been updated with latest results.

Copy link

sonarcloud bot commented May 29, 2024

@zburke zburke merged commit c58e079 into master May 29, 2024
26 checks passed
@zburke zburke deleted the STCOR-846 branch May 29, 2024 21:12
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