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

IBX-6965: Set preview active in the PreviewRequestListener #395

Closed
wants to merge 1 commit into from

Conversation

barw4
Copy link
Member

@barw4 barw4 commented Nov 27, 2023

Question Answer
JIRA issue IBX-6965
Type bug
Target Ibexa version v3.3
BC breaks no

Related PR: https://github.com/ezsystems/ezplatform-page-builder/pull/983 (not needed anymore)

Varnish/Fastly requests are handled by PreviewRequestListener, it should set preview to active, as the name itself says.

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Ran PHP CS Fixer for new PHP code (use $ composer fix-cs).
  • Asked for a review (ping @ezsystems/engineering-team).

@barw4 barw4 added Bug Something isn't working Ready for review labels Nov 27, 2023
@barw4 barw4 self-assigned this Nov 27, 2023
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@barw4 barw4 marked this pull request as ready for review November 27, 2023 14:51
@barw4 barw4 requested a review from a team November 27, 2023 14:51
@micszo micszo self-assigned this Nov 27, 2023
@@ -35,6 +40,8 @@ public static function getSubscribedEvents(): array
*/
public function onKernelRequest(RequestEvent $event): void
{
$this->contentPreviewHelper->setPreviewActive(true);
Copy link
Member

Choose a reason for hiding this comment

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

This change would cause every request to set preview as active, since it subscribes to all KernelEvents::REQUEST events. You need to move this to the block actually determining that it's a preview request - see L50-52.

Looks like it's not as straightforward as it seems, so please see if there's a test coverage for this subscriber and if not please add a unit one covering 2 cases: 1) it's a preview, 2) it's not a preview.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are obviously right, not sure what I was thinking. What is more, adding it to the lines you've mentioned won't work either as a fragment request is in fact a master request. I think this PR becomes obsolete as of now.

@alongosz alongosz requested a review from a team November 27, 2023 18:02
@barw4 barw4 closed this Nov 27, 2023
@barw4 barw4 deleted the ibx-6965-preview-active-in-PreviewRequestListener branch November 27, 2023 22:52
@barw4
Copy link
Member Author

barw4 commented Nov 27, 2023

@micszo micszo removed their assignment Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Ready for review
Development

Successfully merging this pull request may close these issues.

5 participants