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

Sharer gets "Email notification was sent!" message even when the email was not sent #35218

Closed
paurakhsharma opened this issue May 14, 2019 · 10 comments · Fixed by #35220
Closed
Assignees
Labels
1 - To develop p2-high Escalation, on top of current planning, release blocker regression Type:Bug
Milestone

Comments

@paurakhsharma
Copy link
Member

paurakhsharma commented May 14, 2019

Steps to reproduce

Scenario 1: user should get an error message when trying to send notification by email to a user who has not setup their email
    Given parameter "shareapi_allow_mail_notification" of app "core" has been set to "yes"
    And user "user1" has logged in using the webUI
    And user "user1" has shared file "lorem.txt" with user "user2"
    And the user has opened the share dialog for file "lorem.txt"
    When the user sends the share notification by email using the webUI
    Then a notification should be displayed on the webUI with the text "Email notification was not sent!"
  • Note: In the first scenario the email of the receiver is not set.
Scenario 2: user should get an error message when trying to send notification when email server setting is invalid
    Given parameter "shareapi_allow_mail_notification" of app "core" has been set to "yes"
    And user "user1" has logged in using the webUI
    And user "user1" has shared file "lorem.txt" with user "user2"
    And the user has opened the share dialog for file "lorem.txt"
    When the user sends the share notification by email using the webUI
    Then a notification should be displayed on the webUI with the text "Email notification was not sent!"
  • Note: In the second scenario set the receiver's email but change your Email Server setting in Admin General settings page to invalid one.

Actual behaviour

User should get an error message saying "Email notification was sent!"

Expected behaviour

User should get an error message saying "Email notification was not sent!"

c.c @individual-it @phil-davis @PVince81

Response in DevTools

{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"Couldn't send mail to following recipient(s): arkouser ","totalitems":"","itemsperpage":""},"data":[]}}

@paurakhsharma
Copy link
Member Author

paurakhsharma commented May 14, 2019

It turns out after you click on "notify by email" you get a message "Email notification was sent!"
which you should not and if you refresh the page you get to click on the "notify by email" again
which you should not if the email was actually sent.

@paurakhsharma
Copy link
Member Author

paurakhsharma commented May 14, 2019

Could not reproduce in ''10.1"
image

So this is regression

@paurakhsharma
Copy link
Member Author

paurakhsharma commented May 14, 2019

This is the network response in "10.1"
{"data":{"message":"Couldn't send mail to following recipient(s): arkouser "},"status":"error"}

Here the status is "error" compared to "ok" in 10.2 RC2 and RC3

@PVince81
Copy link
Contributor

@VicDeo

@micbar micbar added 1 - To develop p2-high Escalation, on top of current planning, release blocker server-sprint labels May 14, 2019
@micbar micbar modified the milestones: QA, development May 14, 2019
@VicDeo
Copy link
Member

VicDeo commented May 14, 2019

ok, it was a mistake to rely on result.ocs.meta.status when parsing a result.
ocs.meta.status is 200 even when some emails were not sent:

{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"Couldn't send mail to following recipient(s): arkouser ","totalitems":"","itemsperpage":""},"data":[]}}

@PVince81
Copy link
Contributor

@VicDeo why not fix the backend to return the correct value ?

how much of the refactoring/cleanup work that we backported touches this ? did it touch the frontend or only backend ?

@VicDeo
Copy link
Member

VicDeo commented May 14, 2019

@PVince81 a470ac4#diff-e8d8565fb4fcb24d2ff551b5e127cf6a

@PVince81
Copy link
Contributor

thanks for the justification, makes sense

@VicDeo
Copy link
Member

VicDeo commented May 14, 2019

@PVince81 I can mimic the prev behavior but I need help with unsuccessful OCS status clarification.
An old endpoint sent {'status':'success'} or {'status':'error'} via deprecated OCP\JSON class
May be I need just to include the similar field into the ocs response?

@PVince81
Copy link
Contributor

@VicDeo adding the field in the OCS response makes sense.

if that doesn't work out for whatever reason, add a "FIXME" then in the PR

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 - To develop p2-high Escalation, on top of current planning, release blocker regression Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants