fix: stop hiding the entire LinkedIn feed (v1.3.6)#4
Merged
Conversation
v1.3.5 over-corrected the earlier "promoted posts not hidden" report and began hiding organic posts too. Uninstall feedback (2026-06-14): "It hid every post on the feed." Root causes (both introduced in v1.3.5): - hasPromotedStructuralMarker scanned the whole post subtree via post.querySelector(), matching LinkedIn's sponsored-tracked sub-components embedded inside organic posts. Now anchored to the post root plus depth-1 children only, mirroring the existing root-only handling of data-view-tracking-scope. - The injected CSS used substring selectors (main [data-urn*='promoted'], main [data-id*='promoted']) with !important and no restore path, which could blank a feed/aggregation container. Narrowed to the explicit ad attributes on the post card (data-sponsored-tracking-url, data-promoted-tracking-control-name); promoted-URN cases are still caught by the root-anchored JS pass. Added 3 regression tests with a realistic multi-post feed and a deep embedded marker. The prior suite rendered one isolated post per case, so a "hides every post" regression passed CI. Tests 36/36, typecheck, build OK (manifest 1.3.6). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesPromoted post detection false-positive fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Uninstall feedback (2026-06-14): "It hid every post on the feed." v1.3.5 fixed an earlier "promoted posts not hidden" report but over-corrected and started hiding organic posts too.
Root causes (both from v1.3.5)
hasPromotedStructuralMarkerdidpost.querySelector(PROMOTED_STRUCTURAL_SELECTOR)over the whole post subtree, matching LinkedIn's sponsored-tracked sub-components (social-proof chips, "promoted by your network" rails, tracking beacons) that are embedded inside organic posts → the whole post got hidden. Now anchored to the post root + depth-1 children only, mirroring the existing root-only handling ofdata-view-tracking-scope.main [data-urn*='promoted'], main [data-id*='promoted'](!important, no restore path) could match a feed/aggregation container and blank the whole feed. Narrowed to the explicit ad attributes on the post card (data-sponsored-tracking-url,data-promoted-tracking-control-name); promoted-URN ads are still caught by the root-anchored JS pass.Tests
Added 3 regression tests modeling a realistic multi-post feed with a deep embedded marker. The prior suite rendered one isolated post per case, so a "hides every post" regression passed CI. Suite now 36/36; typecheck + build green (manifest 1.3.6).
🤖 Generated with Claude Code