-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Notifications into the queue #1931
Conversation
Probably, yeah.
What about the What problems does this implementation have with the |
What I considered is that if any of the broadcast channel require or expect immediate user interaction, they will fail. I agree there should be no issue running these notifications with sync up until a certain number of recipients is reached and a specific amount of channels is configured. The longer processing the notifications takes the more likely the XHR will time out and the user receives no feedback on whatever they were actually doing.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stuff! Great approach for moving all our emails into the sync queue at once, much better than my modest proposal in #1869. 😉
A few comments - let's discuss this, I am curious to hear what you think.
Just noticed this will also fix #978. 💪 |
@franzliedke I decided in favor of an abstract, can give an opinion on this? |
72e23e0
to
e4e9282
Compare
Rebased, diff is looking much better now. |
a5ff6e7
to
b6f5bb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, what a huge step forward! 👏
However, if I am not misunderstanding things, a small inconsistency got introduced - probably in the latest refactoring step.
a2c269c
to
09eb789
Compare
Forces notifications into a dedicated SendNotificationsJob and passed to the queue. - One static method re-used in the job ::getAttributes, is that okay or use a trait? - Do we want to use this solution and refactor into a better Hub after stable, postpone this implementation or use it in b11?
2177a02
to
9c0c3b7
Compare
This separates sending each individual mail, thus hardening the app. There are still many improvements possible in this code, e.g. chaining these commands, making emails just another notification type and listening to the Notify event instead. We can postpone this to a later stable release.
As discussed with @luceos, let's add this once the use case comes up. It might be a left-over from a previous state of this PR anyway.
This gives extension authors time to add the new `getAttributes()` method to their `BlueprintInterface` implementations. The layer itself is easy to remove in beta.14.
9c0c3b7
to
fb70826
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a call with @luceos in the afternoon and made a few tweaks. I am happy with this now.
We will need the changes from flarum/subscriptions#21 to also move the potentially costly call to the NotificationSyncer
for post subscription notifications to the queue.
No need for breaking backwards compatibility here - encapsulating the logic for `getAttributes()` in one place turns out to be quite useful. Refs #1931.
I removed by weird I moved all of it to the |
Forces notifications into a dedicated SendNotificationsJob and passed to the queue
One static method re-used in the job ::getAttributes, is that okay or use a trait?
Do we want to use this solution and refactor into a better Hub after stable, postpone this implementation or use it in b11?
Fixes #1869
Changes proposed in this pull request:
Forces all notifications into the queue, not just those from subscriptions. Guaranteeing a more streamlined user experience.
Reviewers should focus on:
::getAttribute
. Is this okay or do we want to use a trait?I decided against trying to introduce Laravel notifications channels, because that would bloat our app and increase the weight of this implementation too much.
Confirmed
composer test
).Required changes: