Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pleroma pleroma
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 646
    • Issues 646
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 86
    • Merge requests 86
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PleromaPleroma
  • pleromapleroma
  • Merge requests
  • !2552

Mastodon API return full result set in notifications

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Eugenij requested to merge eugenijm/pleroma:notifications-filtering into develop May 18, 2020
  • Overview 18
  • Commits 1
  • Pipelines 31
  • Changes 8

Re: #1636 (closed)

This is to ensure notifications are not filtered out at the application level and we don't return less than the requested amount of records unless it's the last page. The idea is that instead of relying on safe_render_many (application level filtering), the notifications that can't be rendered should be filtered out in the query.

Right now, the logic for filtering the notifications at the application level is the following:

For a non-superuser: skip notifications from the user that has deactivated, password_reset_pending, confirmation_pending (if account_activation_required is enabled), or invisible flags set to true.

For a superuser: skip invisible and deactivated.

(Unlike deactivation, invisibility doesn't prevent a user from performing actions that create notifications for other users).

In the MR:

  • Actions by invisible accounts do not create notifications
  • Removes the fallbacks that cause notifications to be silently filtered out from the result (now an error will be logged instead).
  • The user visibility check is skipped at the view level when rendering the user account, meaning we rely on the database query to be the single source of truth for the notification visibility
Edited Jun 11, 2020 by Eugenij
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: notifications-filtering