Skip to content

Conversation

y-lakhdar
Copy link
Contributor

@y-lakhdar y-lakhdar commented Oct 17, 2025

Enhanced access token management now supports dynamic token updates at any point in the SSR workflow, eliminating previous timing constraints.

  • Before: setAccessToken had to be called before any engine was created (e.g., before fetching the static state). Calling it afterward (e.g. at post-hydration) would not propagate the change to already created controllers.
  • Now: The access token update logic detects whether an engine has already been created and executes the appropriate update flow accordingly.

I applied to fix to both current and next versions of headless ssr

https://coveord.atlassian.net/browse/KIT-5113

@developer-experience-bot
Copy link
Contributor

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 255.6 255.6 0
commerce 369.4 369.4 0
search 427.1 427.1 0
insight 418.3 418.3 0
recommendation 266.4 266.4 0
ssr 421.5 421.5 0
ssr-commerce 386.5 386.9 0.1
ssr-commerce-next 387.8 388.1 0.1
ssr-next 422.1 422.1 0

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

🔗 Scratch Orgs ready to test this PR:

import {buildLogger} from '../../../app/logger.js';
import {stateKey} from '../../../app/state-key.js';
import type {Controller} from '../../../controllers/controller/headless-controller.js';
import {loadConfigurationActions} from '../../../features/commerce/configuration/configuration-actions-loader.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use alias ?

const mockCallback = vi.fn();
tokenManager.registerCallback(mockCallback);

// Should only receive the latest token
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment needed?

Copy link
Contributor

@vhilotii-coveo vhilotii-coveo left a comment

Choose a reason for hiding this comment

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

LGTM after comments : )

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