-
Notifications
You must be signed in to change notification settings - Fork 46
Prevent PNs from being sent without user using Send button #4081
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
base: develop
Are you sure you want to change the base?
Conversation
92701a3 to
d256ae8
Compare
|
I feel like it would be cleaner to handle a click on send as if the news was scheduled for right now:
I realize that this doesn't work if users want to just set a date, edit content some more later and not have a notification sent out when the date passes and they didn't get around to their finishing touches and explicitly saying "this is ready now". Is this relevant to us? If we don't want this reliance on whether the scheduled timestamp is |
|
Another way to look at it (I hope I imagine the workflow correctly): When the user clicked send, the news is marked as ready to be sent. When they edit it and click save, in my opinion this should not change this ready-to-be-sent status. Currently it marks it as not ready again I think |
integreat_cms/cms/models/push_notifications/push_notification.py
Outdated
Show resolved
Hide resolved
integreat_cms/cms/migrations/0147_pushnotification_ready_to_be_sent.py
Outdated
Show resolved
Hide resolved
integreat_cms/cms/views/push_notifications/push_notification_form_view.py
Show resolved
Hide resolved
Co-authored-by: Peter Nerlich <PeterNerlich@users.noreply.github.com>
Co-authored-by: Peter Nerlich <PeterNerlich@users.noreply.github.com>
…_sent.py Co-authored-by: Peter Nerlich <PeterNerlich@users.noreply.github.com>
Summary of the long discussion
|
Just to clarify - not scheduled means messages that were intended to be sent immediately, so as per @PeterNerlich suggestion they are still scheduled but for immediately, right? Then why can't we resend them as well? They'll have a date in the past, just as the scheduled notifications. |
As "not-scheduled PNs I meant PNs users have sent immediately ("Send" button). I did not implement "re-send per scheduling" for failed not-scheduled PNs, as error messages are shown to users (and users see it). The problem was that users do not recognise an PN failed if it is scheduled (because users are probably not in the CMS system), isn't it? |
Yes, that is definitely the problem - I was wondering why we can't implement the same procedure for PNs that fail when trying to send automatically. I understand that we can simply show the error message and ask users to re-send. Is there an advantage in doing that as opposed to using the same process as for scheduled PNs? |
@osmers
|
Thanks for pointing that out - that was not obvious to me and is a good argument for why not to deal with these PNs in that way. Let's come up with a unified approach during our call :) |
Short description
This PR fixes the bug that PNs which was only saved and not yet "sent" was sent by the management command cron job.
Proposed changes
- Add a flag whether user clicked "Send" button (setready_to_be_senttoTrue).- Check forready_to_be_sent = Truewhen the management command is collecting failed (one-time) PNs- Do not careready_to_be_sent, as scheduled PNs are to be considered as "ready" (agreed here )Side effects
Faithfulness to issue description and design
There are no intended deviations from the issue and design.
How to test
./tools/integreat-cms-cli shelland setsent_dateof Y toNone./tools/integreat-cms-cli send_push_notificationsUse "Testumgebung" or a region which does not exist in the prod system
Resolved issues
Fixes: #4080
Pull Request Review Guidelines