[19.0][IMP] base_tier_validation: reminder cron — batch limit, recordset semantics, orphan guard#39
Open
bosd wants to merge 1 commit into
Open
Conversation
Contributor
|
Hi @LoisRForgeFlow, |
e7179c0 to
d06a380
Compare
d06a380 to
5790db4
Compare
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.
Summary
Forward-port of OCA/server-ux#1281 (authored by @lancelot / Noviat) onto 19.0.
The upstream PR's title only says "increase review limit", but the actual diff fixes three things in one ~15-line change. Worth keeping all three because #2 below is the kind of silent recordset bug that bites you in prod without an error to trace.
1. Batch limit 1 -> 50 in
_get_review_needing_reminderPer cron run, each
tier.definitionreturned at most ONE pending review to remind. With many definitions × few pending reviews that's fine; with one definition × hundreds of pending reviews, you only catch up 1 per run — at default 4 runs/day that's 25 days to remind 100 people. Bumped to 50 per definition per run.2.
_send_review_remindermade recordset-aware_send_review_reminderpreviously assumedselfwas a singleton without callingensure_one()— calling it on a recordset would silently process only the first review and ignore the rest. Now iteratesfor rev in selfproperly. This is what makes #1 actually deliver — without it, bumping the limit would still only send one reminder per cron tick.3. Skip orphaned reviews (
record.exists()guard)A
tier.reviewrow pointing at a deleted document (orphaned because the original record was deleted without cleaning up the review) would crash the cron withRecord does not exist or has been deleted. Now those rows are silently skipped — the cron survives.Forward-port note
The v18 commit used the legacy list-of-tuples domain syntax in
_get_review_needing_reminder; v19 already uses theDomain(...)builder for the same lookup. Trivial conflict resolved by keeping the v19Domain(...)shape and only carrying over thelimit=1 -> limit=50change. All other lines applied cleanly.Credit
Original commit:
da31cda5by @lancelot.Test plan
Manual: create a tier definition with
notify_reminder_delay=1, generate ≥2 pending reviews older than 1 day, run the reminder cron. Before: only one gets a reminder. After: all of them up to 50/run.