Skip to content

Conversation

@jonathanKingston
Copy link
Contributor

@jonathanKingston jonathanKingston commented Oct 24, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/task/1211745324203561?focus=true

Description

Ignores both:

  • cache when no body
  • cache when body is empty

Testing Steps

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Note

Prevents caching blank page content and guards MutationObserver to start only when document.body is available.

  • Page context (injected/src/features/page-context.js):
    • Observation Guard: Start MutationObserver only if document.body exists.
    • Cache Logic: Cache collection results only when content.content.length > 0 (skip empty content).

Written by Cursor Bugbot for commit ff4983e. This will update automatically on new commits. Configure here.

@netlify
Copy link

netlify bot commented Oct 24, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit ff4983e
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/68fbe2c1e231ef00088d0402
😎 Deploy Preview https://deploy-preview-2033--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

[Beta] Generated file diff

Time updated: Tue, 28 Oct 2025 01:00:04 GMT

Apple
    - apple/contentScope.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

@noisysocks noisysocks requested a review from Copilot October 27, 2025 05:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the page context caching logic to prevent caching of blank or empty page content. The changes ensure that mutation observers only start when there is actual content to observe and that empty content is not stored in the cache.

Key changes:

  • Added document.body check before starting mutation observer
  • Conditionally cache content only when it contains actual data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@noisysocks noisysocks marked this pull request as ready for review October 28, 2025 00:59
@noisysocks noisysocks requested a review from a team as a code owner October 28, 2025 00:59
Copy link
Contributor

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

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

Tested locally within macOS by browsing to a page on Wikipedia and then browsing to https://www.thewholesomedish.com/the-best-homemade-tacos/. Without this change, page context is not attached automatically. With this change, it is.

@noisysocks noisysocks added this pull request to the merge queue Oct 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 28, 2025
@noisysocks noisysocks added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit ee0469d Oct 28, 2025
29 checks passed
@noisysocks noisysocks deleted the jkt/remove-blank-cache branch October 28, 2025 10:06
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.

2 participants