This repository was archived by the owner on May 29, 2026. It is now read-only.
fix: resolve gate-3 stub-scan (implement BerichtenboxReadStatusJob.run())#630
Merged
Conversation
…un() run() was an empty stub containing only a log line and a comment. The job injected BerichtenboxService but never called it. Added: - IAppManager guard (skip if openregister not installed) - BerichtenboxService::getPendingMessages() method that fetches all 'sent' and 'unread_flagged' messages from OpenRegister - Loop in run() that calls pollReadStatus() for each pending message, updating status to 'read' / 'unread_flagged' via the existing service logic
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What the stub was
BerichtenboxReadStatusJob::run()was an empty stub: it logged one info line and contained only a comment saying "The actual polling happens in BerichtenboxService::pollReadStatus / This job would iterate unread messages and poll each one." The service was injected in the constructor but never called fromrun(). Gate-3 flagged it as a stub because there were < 2 non-logger statements in the body.The job is registered in
appinfo/info.xml's<background-jobs>section, so it runs daily in production — doing nothing.Fix decision: implement with real bulk polling
The job's intent was clear from the comment and from
BerichtenboxService::pollReadStatus()(already implemented, used by the controller endpoint). The background job should poll ALL pending messages, not just individual ones.Changes:
lib/Service/BerichtenboxService.php— addedgetPendingMessages(): fetches all messages with status'sent'or'unread_flagged'that may need a read-status update (matching the statuses set bypollReadStatus())lib/BackgroundJob/BerichtenboxReadStatusJob.php:IAppManagerinjection (openregister availability guard — same pattern asAdviceDeadlineJob)run(): guard check →getPendingMessages()→ loop callingpollReadStatus()per message → summary logGate-3 result
[gate-3] stub-scan: PASS