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

[ECP-9599]Implement the tracking of Headless requests to the FrontEndType header #2897

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

khushboo-singhvi
Copy link
Contributor

Description
This PR aims tracking the Headless Frontend type requests, If it is Graphql requests, the EXTERNAL_PLATFORM_FRONTEND_TYPE will be set as headless-graphql and falling back to REST Headless for all other remaining scenarios with the value set as headless-rest

Tested scenarios

Fixes

amihajlovski
amihajlovski previously approved these changes Feb 26, 2025
if (str_contains($requestUri, '/graphql')) {
$frontendType = 'headless-graphql';
} else {
$frontendType = 'headless-rest';
Copy link
Member

Choose a reason for hiding this comment

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

Express payments will fall under headless-rest category unless we indicate the frontendType in additional_data of place order functions of express method renderers. This might require some data clean-up to remove express payments from headless-rest payments. However, it would become cumbersome after having a huge data set. We can merge this as it is but until fixing it on express payment module, we will get some dirty data. Could you please check this with product?

Helper/Data.php Outdated
if (is_null($frontendType)) {
// Check the request URI
$requestUri = $this->request->getPathInfo();
if (str_contains($requestUri, '/graphql')) {
Copy link
Member

Choose a reason for hiding this comment

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

This logical comparison might create false-positives. Let's discuss it separately.

@khushboo-singhvi khushboo-singhvi changed the title Implement the tracking of Headless requests to the FrontEndType header [ECP-9599]Implement the tracking of Headless requests to the FrontEndType header Feb 27, 2025
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