Navigation Menu

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

Update mark notification as read method #17518

Merged
merged 3 commits into from May 12, 2021
Merged

Conversation

flamisz
Copy link
Contributor

@flamisz flamisz commented May 4, 2021

Description:

As in title.

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@flamisz flamisz added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels May 4, 2021
@flamisz flamisz added this to the 4.3.0 milestone May 4, 2021
@flamisz flamisz self-assigned this May 4, 2021
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flamisz Did you test that locally? For me the XHR request is actually never sent, as the notificationId is always null. Guess it needs to be passed to markNotificationAsRead from the html template instead, as it isn't available in the controller.

@tsteur
Copy link
Member

tsteur commented May 5, 2021

btw @sgiehl @flamisz not sure what you exactly meant in the comment but if the request isn't sent currently that might be because of #15575 (comment) which may need to be fixed in order to test this issue :)

@tsteur
Copy link
Member

tsteur commented May 5, 2021

it might be totally unrelated though so feel free to ignore, only thought to mention it in case it's related

@flamisz
Copy link
Contributor Author

flamisz commented May 5, 2021

@flamisz Did you test that locally? For me the XHR request is actually never sent, as the notificationId is always null. Guess it needs to be passed to markNotificationAsRead from the html template instead, as it isn't available in the controller.

@tsteur @sgiehl I realizes something is not ok with the notification, but I thought I just don't know how to use it properly. I was able to test it tho. I created permanent notification (hardcoded somewhere into a plugin) and used an API call to mark as readed. Before the PR I was able to mark as readed so it disappeared for the next request. With this modifications I needed a token to do that.

@tsteur
Copy link
Member

tsteur commented May 5, 2021

👍 we'd just need to double check that we also send the token in the actual request from the notification JS otherwise it won't work basically (but it's not working there currently anyway so could also ignore it and not test it)

@sgiehl
Copy link
Member

sgiehl commented May 6, 2021

@flamisz while reviewing I actually saw why the notification xhr didn't work properly. I've pushed a commit to this branch to fix that. So maybe this then also fixes #15575

@flamisz
Copy link
Contributor Author

flamisz commented May 6, 2021

@flamisz while reviewing I actually saw why the notification xhr didn't work properly. I've pushed a commit to this branch to fix that. So maybe this then also fixes #15575

thanks @sgiehl, this makes sense. I just wasn't sure if it's a bug or my lack of knowledge 😄

@sgiehl
Copy link
Member

sgiehl commented May 11, 2021

@flamisz I've rebased the branch and added some new UI tests to check that closing the notifications work as expected. Feel free to have a look at the UI tests and merge the PR if they look good to you.

@flamisz
Copy link
Contributor Author

flamisz commented May 11, 2021

@flamisz I've rebased the branch and added some new UI tests to check that closing the notifications work as expected. Feel free to have a look at the UI tests and merge the PR if they look good to you.

Thanks, @sgiehl, looking good 👍
Probably wait with the merge until we have the new release.

@sgiehl
Copy link
Member

sgiehl commented May 12, 2021

Might maybe be worth to include that in 4.3.0 maybe, as it fixes the uncloseable notification issue. ping @tsteur

@tsteur tsteur merged commit 8468e52 into 4.x-dev May 12, 2021
@tsteur tsteur deleted the marknotificationasread branch May 12, 2021 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants