-
-
Notifications
You must be signed in to change notification settings - Fork 485
download: Show in-app notification on downlaoding a file. #1466
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: main
Are you sure you want to change the base?
Conversation
| "show-download-success", | ||
| notificationTitle, | ||
| notificationBody, | ||
| ); |
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.
This seems to do both the old notification mechanism and the new one -- is that intendedd?
It is important for backwards-compatibility to make sure we do the old thing on existing web app versions. But I don't know if doing both would be problematic, and in any case, I would expect some sort of detection logic and comments explaining the reasoning behind what we're 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.
Yes, that is intended. My understanding of the requirements is that we want to show both in-app and native notifications. @alya let me know if that is not the case.
Added comments.
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 question, I was imagining we'd have both, but I'm not sure if it's silly to do it that way. If you'd be up for it, it might be good to check how a few other apps handle it. Trying Discord, Slack, and WhatsApp, it seems like they pick one or the other, unless my desktop notifications aren't working properly.
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.
So possibly we'd suppress the native notification when showing the in-app one.
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.
I think we don't want to send both. There are some potential advantages to the native notification; It appears even if your desktop app is not focused -- say if you started downloading a long video and then tabbed away.
Is there a way to check if the native notification actually sent?
Fixes zulip#1371. We do not accept a filePath from the web app when recieving the event to show the file in a folder, since that could introduce securithy vulnerabilies. We store the latest downloaded file path instead in a variable. Only one in-app notification is active at a time, so storing the latest file path is enough for out use case.
a5ad948 to
55867de
Compare
| title: notificationTitle, | ||
| body: notificationBody, | ||
| silent: true, // We'll play our own sound - ding.ogg | ||
| }); |
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.
So the original issue is a complaint about the native notifications not working on Windows. Do we understand how that's happening? I feel like papering over a bug like that without understanding it is risky -- have you tried arranging an interactive debugging session with someone experiencing the bug?
Fixes #1371.
We do not accept a filePath from the web app when recieving the event to show the file in a folder, since that could introduce securithy vulnerabilies. We store the latest downloaded file path instead in a variable. Only one in-app notification is active at a time, so storing the latest file path is enough for out use case.
To test this PR, run a zulip server that runs the branch on zulip/zulip#36408 and add it to the zulip desktop app running on this PR. Upload a file and download it to test.
Screenshots and screen captures:


Platforms this PR was tested on:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: