Skip to content

Better viewonline route checking - #194

Merged
iMattPro merged 1 commit into
phpbb-extensions:masterfrom
iMattPro:updates
Aug 18, 2026
Merged

Better viewonline route checking#194
iMattPro merged 1 commit into
phpbb-extensions:masterfrom
iMattPro:updates

Conversation

@iMattPro

Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.38%. Comparing base (3ad1333) to head (476330d).

Files with missing lines Patch % Lines
event/listener.php 90.90% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #194      +/-   ##
============================================
+ Coverage     60.00%   60.38%   +0.38%     
- Complexity      222      226       +4     
============================================
  Files            18       18              
  Lines           815      828      +13     
============================================
+ Hits            489      500      +11     
- Misses          326      328       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iMattPro
iMattPro requested a lite review from Copilot August 18, 2026 14:07
@iMattPro
iMattPro merged commit 4f13b45 into phpbb-extensions:master Aug 18, 2026
35 checks passed
@iMattPro
iMattPro deleted the updates branch August 18, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves how the Pages extension detects “who is viewing a Page” in the Who Is Online view by matching against Symfony route paths rather than relying on a specific front-controller name (e.g., app.php) or exact session_page string equality.

Changes:

  • Inject the phpBB router into the Pages event listener and use it to map route paths to Pages dynamic route IDs.
  • Update viewonline_page() to parse session_page, strip the front controller, and resolve the page by route path (including query-string tolerance).
  • Extend and adjust unit tests to cover alternative front-controller names and query strings; update listener construction in tests and service wiring.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
event/listener.php Reworks viewonline location detection using router route paths and cached path→page-id mapping.
config/services.yml Adds the router service as a constructor argument for the Pages listener.
tests/event/event_listener_base.php Provides a mocked router + route collection to support the new listener dependency in tests.
tests/event/event_listener_viewonline_test.php Adds test cases for non-app.php front controllers and query strings in session_page.
tests/event/show_page_links_test.php Updates listener instantiation to supply the newly required router dependency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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