Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reminders notifications are not generated correctly #2303

Closed
pronguen opened this issue Aug 17, 2021 · 1 comment · Fixed by #2349
Closed

Reminders notifications are not generated correctly #2303

pronguen opened this issue Aug 17, 2021 · 1 comment · Fixed by #2349
Assignees
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend f: notifications p-High High priority (to be solved in the 2-3 next months) production Issue specifically spotted on the production server

Comments

@pronguen
Copy link
Contributor

pronguen commented Aug 17, 2021

Describe the bug

Reminders notifications are not generated correctly. For a due date on 2021-08-14, only one reminder should have been generated, but they are all (1st, 2nd, 3rd and 4th) generated, merged and sent in the same notification, even if the communication channel is different (4th should be per mail).

See example.

To Reproduce

See example

Expected behavior

Notifications are grouped only if they have

  • same recipient (either library or patron) AND same communication channel

Reminder notifications are generated on the right date.

Context

Example

Due date of all items is 14.08.
One of the loans: https://bib.rero.ch/api/loans/160064 - vs

Titre : Aquitaine : Bordelais, Landes, Pays basque, Béarn, Lot-et-Garonne / Echéance : 13.08.2021 Note : deuxième rappel
Titre : Aquitaine : Bordelais, Landes, Pays basque, Béarn, Lot-et-Garonne / Echéance : 13.08.2021 Note : premier rappel
Titre : Aquitaine : Bordelais, Landes, Pays basque, Béarn, Lot-et-Garonne / Echéance : 13.08.2021 Note : quatrième rappel
Titre : Aquitaine : Bordelais, Landes, Pays basque, Béarn, Lot-et-Garonne / Echéance : 13.08.2021 Note : troisième rappel
Titre : Lyon et sa région / rédaction Luc Decoudin ... [et al.] Echéance : 13.08.2021 Note : deuxième rappel
Titre : Lyon et sa région / rédaction Luc Decoudin ... [et al.] Echéance : 13.08.2021 Note : premier rappel
Titre : Lyon et sa région / rédaction Luc Decoudin ... [et al.] Echéance : 13.08.2021 Note : quatrième rappel
Titre : Lyon et sa région / rédaction Luc Decoudin ... [et al.] Echéance : 13.08.2021 Note : troisième rappel
Titre : Pyrénées, Toulouse, Gers / Echéance : 13.08.2021 Note : deuxième rappel
Titre : Pyrénées, Toulouse, Gers / Echéance : 13.08.2021 Note : premier rappel
Titre : Pyrénées, Toulouse, Gers / Echéance : 13.08.2021 Note : quatrième rappel
Titre : Pyrénées, Toulouse, Gers / Echéance : 13.08.2021 Note : troisième rappel
Titre : Périgord Quercy : Dordogne Lot / Echéance : 13.08.2021 Note : deuxième rappel
Titre : Périgord Quercy : Dordogne Lot / Echéance : 13.08.2021 Note : premier rappel
Titre : Périgord Quercy : Dordogne Lot / Echéance : 13.08.2021 Note : quatrième rappel
Titre : Périgord Quercy : Dordogne Lot / Echéance : 13.08.2021 Note : troisième rappel

Screenshots

image

@pronguen pronguen added f: circulation Concerns the circulation interface or backend f: notifications bug Breaks something but is not blocking p-High High priority (to be solved in the 2-3 next months) production Issue specifically spotted on the production server labels Aug 17, 2021
@zannkukai
Copy link
Contributor

**about "Reminder notifications are generated on the right date" problem **

It's really complicated to trace the reminders generation process without all informations and configurations + access to server log (current_app.logger).

In this case the "problem" (if it exists - we need to check cipo configuration), is that the system consider that this overdue loan must generate 4 overdue reminders

open_days = loan_library.count_open(
start_date=loan.overdue_date,
end_date=tstamp
)
circ_policy = get_circ_policy(loan)
logger.debug(f' - this loan use the cipo#{circ_policy.pid}')
logger.debug(f' - open days from loans due_date :: {open_days}')
reminders = circ_policy.get_reminders(
reminder_type=OVERDUE_REMINDER_TYPE,
limit=open_days

--> The last line, return 4 overdue reminders to generate for the corresponding open days since due_date ; none are already sent, then fourth are generated in the same time.

The reasons could be :

  • bad/strange cipo configuration.
  • the notifications tasks doesn't works for few days, then run and generate all notifications at once.
  • updated loan information (due_date / library) by CLI

Note : library.count_open() and cipo.get_reminders() functions seem correctly tested by unittest code.

about "group notification by communication channel" problem.

I created into the #2312 PR a new aggregations subdivision to group notification by communication channel.

@zannkukai zannkukai self-assigned this Aug 20, 2021
jma added a commit to jma/rero-ils that referenced this issue Sep 1, 2021
* Closes: rero#2303.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
jma added a commit to jma/rero-ils that referenced this issue Sep 1, 2021
* Does not send overdue notification if the library is closed between
  the end date and the processing date.
* Closes: rero#2303.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
iGormilhit pushed a commit that referenced this issue Sep 2, 2021
* Does not send overdue notification if the library is closed between
  the end date and the processing date.
* Closes: #2303.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend f: notifications p-High High priority (to be solved in the 2-3 next months) production Issue specifically spotted on the production server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants