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

[FEAT] Record the user that initiated a notification event #221

Open
chungthuang opened this issue Sep 7, 2024 · 11 comments
Open

[FEAT] Record the user that initiated a notification event #221

chungthuang opened this issue Sep 7, 2024 · 11 comments
Assignees

Comments

@chungthuang
Copy link
Contributor

Summary
As the owner of an idea card, I'd like to know who commented on my ideas.

Describe the solution you'd like
Add a new field in the event collection to record the user that triggered the event. We need to update the lifecycle method that generates the event to send the user information.

Acceptance criteria
Integration test should assert that when user A comments on an idea card owned by user B, user B is able to see user A commented on the idea. For privacy concerns, user B should only see public information about user A.

@j-peace
Copy link
Contributor

j-peace commented Sep 14, 2024

1st scenario: Other users comment in my Idea and my notifications are on:

  • WHEN: I create an Idea.
  • AND: Other users comments in my idea.
  • THAN: I should receive a notification (with just public information who comments in my idea).

2nd scenario: Other users comment in my Idea and my notifications are off:

  • WHEN: I create an Idea.
  • AND: Other users comments in my idea.
  • THAN: I should not receive a notification.

3rd scenario: I comment in my own Idea:

  • WHEN: I create an Idea.
  • AND: I comment in my idea.
  • THAN: I should not receive a notification.

Important to validate

  • What is the expected default settingd? Comment notificarions on or off ?
  • Users that has more than one idea, should be able to turn on/off comment notifications for junt an specific idea? Or the settings are valid for all their ideas?

@dbradham
Copy link
Contributor

@tiagopazhs @oriyomibadmus do either of you have availability to discuss this on Tuesday after 6:30pm Central time?

@j-peace
Copy link
Contributor

j-peace commented Sep 17, 2024

Hey @dbradham 6:30pm CT looks good ?

@j-peace
Copy link
Contributor

j-peace commented Sep 17, 2024

Sorry for the latest answear, we can schedulle another time ?

@dbradham
Copy link
Contributor

  • Users that has more than one idea, should be able to turn on/off comment notifications for junt an specific idea?

After discussion, we have determined scenario 2 & 3 are outside the acceptance criteria for this ticket.

The expected settings are for notifications to be on.

@tiagopazhs has asked the IdeaSpace team for feedback on the idea-specific notification settings.

@j-peace
Copy link
Contributor

j-peace commented Sep 21, 2024

@oriyomibadmus as we discussed with @dbradham the field Comment.author is not used anymore. Please remove that.

@j-peace
Copy link
Contributor

j-peace commented Sep 21, 2024

@oriyomibadmus and @dbradham,

We can have a discussion here why we weren't able to reproduce the error using the admin pannel ?

  • params used to create the comment:
    image

  • note that when we retrieve the comment after it was created the field user was not persisted:
    image

@dbradham
Copy link
Contributor

Image

This behavior is unstable due to the hook on line 6 of this screenshot @tiagopazhs

  • We are not authenticated from the dashboard as a user, so the application appears to default to the first user created in the database.
  • We should test the user relation in an environment where we are authenticated.
  • For example, we can run the frontend application, authenticate with the backend, and then submit a comment.
  • Alternatively, we could authenticate with postman or a test script and then submit a comment payload with a token to the application.

@dbradham
Copy link
Contributor

Cross testing:
I can see the event is linked to my user. (id: 48)

Image

I can see my user is linked to the comment, correctly, because I am logged into the application. This is different from Tiago's test where he was not authenticated and using the Strapi admin panel-
Image

@dbradham
Copy link
Contributor

@oriyomibadmus The title of the Event seems strange "null commented on...".

It seems that this was working differently for Vivien 11 days ago.
Image

I believe the issue is because my user has no username-
Image

Image

When I updated my username in the staging database, I got the expected result:
Image

@chungthuang please let us know if the acceptance criteria is met here. It seems to work as expected from my tests.

@dbradham
Copy link
Contributor

@chungthuang I am moving this to Done per our discussion in the team sync call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants