Skip to content

fix: make notification repository user-scoped - #626

Open
elphizu wants to merge 5 commits into
WordPress:developfrom
elphizu:fix/user-scoped-notification-repository
Open

elphizu wants to merge 5 commits into
WordPress:developfrom
elphizu:fix/user-scoped-notification-repository

Conversation

@elphizu

@elphizu elphizu commented Oct 16, 2026

Copy link
Copy Markdown

What?

Make the notification repository interface user-scoped and remove the unused WP\Notifications\Notification interface.

Why?

The repository contract cannot currently query or update notifications for a specific user, or express message fan-out to multiple recipients. The unused notification interface also references types that do not exist.

Fixes #612.

How?

  • Use the existing Model\Message and Model\Notification types.
  • Add user-scoped lookup, count, dismissal, display, and removal methods.
  • Add message fan-out and orphan-purge contracts.
  • Document supported query arguments and return shapes.
  • Pass the user ID through the date-range helpers.
  • Update the database stubs and load the Order interface during bootstrap.

Database persistence remains part of #42.

Testing Instructions

  1. Install dependencies with npm ci and composer install.
  2. Start the test environment with npx wp-env start.
  3. Run npm run test:php.
  4. Confirm the new repository test passes, verifying that find_latest() forwards the user ID, date range, sort order, pagination, and offset.
  5. Run composer lint.

Use of AI Tools

AI assistance: Yes
Tool: OpenAI Codex

@elphizu
elphizu marked this pull request as ready for review October 16, 2026 11:15
@jonathanbossenger jonathanbossenger mentioned this pull request Oct 16, 2026
2 of 22 tasks
Comment thread includes/persistence/interface-notification-repository.php Outdated
Comment thread includes/persistence/interface-notification-repository.php Outdated
Comment thread includes/persistence/interface-notification-repository.php Outdated
Comment thread includes/persistence/interface-notification-repository.php
@jonathanbossenger

Copy link
Copy Markdown
Collaborator

Thanks, @elphizu. This looks good. I'm just waiting till all the PRs in #607 are merged, and then I'll start merging PRs that work towards closing #302

This branch has not been deployed

No deployments
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.

Delete interface-notification.php and make the repository interface user-scoped

2 participants