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

Closes #31: Add a check if page is scrolled down. #32

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Oct 8, 2024

Description

Fixes #31
This PR adds a check to ensure that the beacon is not fired if the page is scrolled down before it runs.

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

Technical description

Documentation

The _isPageScrolled() method is used in BeaconManager.js to check if the page is scrolled and bails out if it returns true. In-build test have been added as well.

New dependencies

None

Risks

None

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@Miraeld Miraeld added the bug Something isn't working label Oct 8, 2024
@Miraeld Miraeld requested a review from a team October 8, 2024 02:12
@Miraeld Miraeld self-assigned this Oct 8, 2024
Copy link

codacy-production bot commented Oct 8, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+3.19% (target: -1.00%) 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (78ca211) 578 349 60.38%
Head commit (4f760de) 645 (+67) 410 (+61) 63.57% (+3.19%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#32) 10 10 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Khadreal
Khadreal previously approved these changes Oct 8, 2024
Copy link
Collaborator

@wordpressfan wordpressfan left a comment

Choose a reason for hiding this comment

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

I think @Miraeld is not working today, I'll go ahead and do that small change by myself.

src/BeaconManager.js Outdated Show resolved Hide resolved
@Khadreal Khadreal merged commit 9fee2d8 into develop Oct 16, 2024
6 checks passed
@Khadreal Khadreal deleted the fix/31-add-scrolling-check branch October 16, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong OCI picked up if scroll happens before beacon fires - Beacon side
3 participants