Skip to content

Conversation

cerebrl
Copy link
Collaborator

@cerebrl cerebrl commented Sep 3, 2025

JIRA Ticket

SDKS-4314

Description

Implements force renew feature for .tokens.get and revokes old tokens that are to be replaced.

Copy link

changeset-bot bot commented Sep 3, 2025

🦋 Changeset detected

Latest commit: bdbbbd2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@forgerock/oidc-client Minor
@forgerock/davinci-client Minor
@forgerock/protect Minor
@forgerock/sdk-types Minor
@forgerock/sdk-utilities Minor
@forgerock/iframe-manager Minor
@forgerock/sdk-logger Minor
@forgerock/sdk-oidc Minor
@forgerock/sdk-request-middleware Minor
@forgerock/storage Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

nx-cloud bot commented Sep 3, 2025

View your CI Pipeline Execution ↗ for commit bdbbbd2

Command Status Duration Result
nx run-many -t build ✅ Succeeded <1s View ↗
nx affected -t build typecheck lint test e2e-ci ✅ Succeeded 1m 7s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-04 16:41:38 UTC

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Deployed 02e0637 to https://ForgeRock.github.io/ping-javascript-sdk/pr-402/02e063742b23ea9d648599a859dc00062602c99a branch gh-pages in ForgeRock/ping-javascript-sdk

Copy link
Contributor

github-actions bot commented Sep 3, 2025

📦 Bundle Size Analysis

📦 Bundle Size Analysis

📊 Minor Changes

📈 @forgerock/oidc-client - 22.4 KB (+0.1 KB)

➖ No Changes

@forgerock/davinci-client - 34.1 KB
@forgerock/sdk-utilities - 4.0 KB
@forgerock/device-client - 9.2 KB
@forgerock/sdk-types - 5.9 KB
@forgerock/protect - 150.1 KB
@forgerock/sdk-oidc - 2.7 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/storage - 1.4 KB
@forgerock/sdk-request-middleware - 4.4 KB
@forgerock/iframe-manager - 2.4 KB


11 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@cerebrl cerebrl force-pushed the oidc-force-renew-tokens branch from 62a33ca to f12df12 Compare September 3, 2025 19:17
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.47%. Comparing base (4d4be08) to head (bdbbbd2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #402   +/-   ##
=======================================
  Coverage   55.47%   55.47%           
=======================================
  Files          32       32           
  Lines        2044     2044           
  Branches      340      340           
=======================================
  Hits         1134     1134           
  Misses        910      910           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

});

it('Get expired tokens without background renewal', async () => {
customStorage['pic-oidcTokens'] = JSON.stringify({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we cleaning this up every test? Does reset handlers do that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I'm not cleaning it up. I'm not sure I need to. The storage is declared within the describe function body, so as soon as the tests are done, that closure is cleared out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The only concern is that if we don't, then the storage is carried through to each test as it was mutated in the one before.

If someone new comes in and adds a test and doesn't read through the whole suite, then it could catch them by surprise or even affect a future test unexpectedly.

I think its worth cleaning storage after each test, but if you feel strongly we dont have to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, fair enough. I'll make the change.

@cerebrl cerebrl force-pushed the oidc-force-renew-tokens branch from f12df12 to 9ba076c Compare September 4, 2025 15:45
@cerebrl cerebrl force-pushed the oidc-force-renew-tokens branch from 9ba076c to bdbbbd2 Compare September 4, 2025 16:39
Copy link
Collaborator

@ryanbas21 ryanbas21 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,

only note is remove of tokens is a touch redundant if we set but its also explicit which is helpful.

@cerebrl cerebrl merged commit f449b49 into main Sep 5, 2025
3 checks passed
@cerebrl cerebrl deleted the oidc-force-renew-tokens branch September 5, 2025 15:55
@ryanbas21 ryanbas21 mentioned this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants