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

Notifications overhaul #15040

Merged
merged 12 commits into from
Jul 17, 2019
Merged

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Apr 10, 2019

  • New "state of the art" registration method for notifiers and apps, this breaks, yes. But it's intentionally to make the devs aware of all the changes. Also I will provide PRs where possible
  • Added return types and parameter type hints
  • New action type "WEB" to allow to redirect to a given page. E.g. for calls, because you can not start a call on any page (yet)
  • Unify the way how notifications are marked "processed" when they should be deleted, also to allow … v
  • Silent push notification when one is deleted.
  • Notification app adjustments: Send a push message when a notification was deleted notifications#318
  • Update all shipped notifiers
  • Send PRs to all other notifiers

Fix #13980

@MorrisJobke MorrisJobke mentioned this pull request Jul 15, 2019
28 tasks
@nickvergessen nickvergessen added the 3. to review Waiting for reviews label Jul 16, 2019
@nickvergessen
Copy link
Member Author

Ready to review.

Would also be nice if you can check the notifications PR (see PR description) and the PRs to all affected apps (linked around the last comment from morris)

Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Beside my little nitpick the code change looks good 👍

@MorrisJobke
Copy link
Member

Tested and works 👍

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

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

changes look good

@MorrisJobke MorrisJobke merged commit 5b604ea into master Jul 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/13980/push-for-deleted-notifications branch July 17, 2019 18:22
@skjnldsv
Copy link
Member

skjnldsv commented Jul 28, 2019

@nickvergessen Our deprecation guidelines is to wait 3 releases before removing the old legacy way. Now on latest master everything is failing for me.

I get empty css on almost all apps that uses the old notifications way because it gets thrown before.

Updating spreed to latest master fixed it for me.
Though this is not the way we usually do and everyone have to wait before changing apis. Why did we suddenly approved breaking change on a single pull request without a proper deprecation process? 🤷‍♀️

Deprecated is different from removed. If you kill a method, you don't deprecate it, you remove it. Deprecation = warning but still functional! 🤔

Capture d’écran_2019-07-28_10-16-08

{
  "reqId": "H90SnKlyMmWFtO2itxYU",
  "level": 3,
  "time": "2019-07-28T08:16:57+00:00",
  "remoteAddr": "172.21.0.1",
  "user": "Test1",
  "app": "no app in context",
  "method": "GET",
  "url": "/ocs/v2.php/apps/spreed/api/v1/room",
  "message": {
    "Exception": "InvalidArgumentException",
    "Message": "Notifier Talk (id: spreed) is not considered because it is using the old way to register.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/apps2/spreed/lib/AppInfo/Application.php",
        "line": 136,
        "function": "registerNotifier",
        "class": "OC\\Notification\\Manager",
        "type": "->",
        "args": [
          {
            "__class__": "Closure"
          },
          {
            "__class__": "Closure"
          }
        ]
      },
      {
        "file": "/var/www/html/apps2/spreed/lib/AppInfo/Application.php",
        "line": 99,
        "function": "registerNotifier",
        "class": "OCA\\Spreed\\AppInfo\\Application",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\Server"
          }
        ]
      },
      {
        "file": "/var/www/html/apps2/spreed/appinfo/app.php",
        "line": 24,
        "function": "register",
       {
  "reqId": "H90SnKlyMmWFtO2itxYU",
  "level": 3,
  "time": "2019-07-28T08:16:57+00:00",
  "remoteAddr": "172.21.0.1",
  "user": "Test1",
  "app": "no app in context",
  "method": "GET",
  "url": "/ocs/v2.php/apps/spreed/api/v1/room",
  "message": {
    "Exception": "InvalidArgumentException",
    "Message": "Notifier Talk (id: spreed) is not considered because it is using the old way to register.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/apps2/spreed/lib/AppInfo/Application.php",
        "line": 136,
        "function": "registerNotifier",
        "class": "OC\\Notification\\Manager",
        "type": "->",
        "args": [
          {
            "__class__": "Closure"
          },
          {
            "__class__": "Closure"
          }
        ]
      },
      {
        "file": "/var/www/html/apps2/spreed/lib/AppInfo/Application.php",
        "line": 99,
        "function": "registerNotifier",
        "class": "OCA\\Spreed\\AppInfo\\Application",
        "type": "->",
        "args": [
          {
            "__class__": "OC\\Server"
          }
        ]
      },
      {
        "file": "/var/www/html/apps2/spreed/appinfo/app.php",
        "line": 24,
        "function": "register",
        "class": "OCA\\Spreed\\AppInfo\\Application",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/legacy/app.php",
        "line": 262,
        "args": [
          "/var/www/html/apps2/spreed/appinfo/app.php"
        ],
        "function": "require_once"
      },
      {
        "file": "/var/www/html/lib/private/legacy/app.php",
        "line": 155,
        "function": "requireAppFile",
        "class": "OC_App",
        "type": "::",
        "args": [
          {
            "__class__": "OCA\\Spreed\\AppInfo\\Application"
          }
        ]
      },
      {
        "file": "/var/www/html/lib/private/legacy/app.php",
        "line": 128,
        "function": "loadApp",
        "class": "OC_App",
        "type": "::",
        "args": [
          "spreed"
        ]
      },
      {
        "file": "/var/www/html/ocs/v1.php",
        "line": 56,
        "function": "loadApps",
        "class": "OC_App",
        "type": "::",
        "args": []
      },
      {
        "file": "/var/www/html/ocs/v2.php",
        "line": 24,
        "args": [
          "/var/www/html/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/Notification/Manager.php",
    "Line": 86,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
  "version": "17.0.0.1"
} "class": "OCA\\Spreed\\AppInfo\\Application",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/legacy/app.php",
        "line": 262,
        "args": [
          "/var/www/html/apps2/spreed/appinfo/app.php"
        ],
        "function": "require_once"
      },
      {
        "file": "/var/www/html/lib/private/legacy/app.php",
        "line": 155,
        "function": "requireAppFile",
        "class": "OC_App",
        "type": "::",
        "args": [
          {
            "__class__": "OCA\\Spreed\\AppInfo\\Application"
          }
        ]
      },
      {
        "file": "/var/www/html/lib/private/legacy/app.php",
        "line": 128,
        "function": "loadApp",
        "class": "OC_App",
        "type": "::",
        "args": [
          "spreed"
        ]
      },
      {
        "file": "/var/www/html/ocs/v1.php",
        "line": 56,
        "function": "loadApps",
        "class": "OC_App",
        "type": "::",
        "args": []
      },
      {
        "file": "/var/www/html/ocs/v2.php",
        "line": 24,
        "args": [
          "/var/www/html/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/Notification/Manager.php",
    "Line": 86,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
  "version": "17.0.0.1"
}

@nickvergessen
Copy link
Member Author

This has been discussed in length above and in the linked issues.

@nickvergessen
Copy link
Member Author

But then again, the exception is only logged, not thrown and it should therefor also not fail somewhere resulting in such pages.

@skjnldsv
Copy link
Member

@nickvergessen yes, you're right!
After upgrading spreed, it worked again (though, all my instance was broken because of this)

Nonetheless, I think we should respect the deprecation process we have as much as we can :)
But maybe we couldn't avoid this! I was just surprised ;)

Nice work though! Much cleaner code!

@MorrisJobke
Copy link
Member

@nickvergessen Our deprecation guidelines is to wait 3 releases before removing the old legacy way.

@skjnldsv It's years and not releases. We are waiting 3 years until deprecated stuff is removed.

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

Successfully merging this pull request may close these issues.

Sync (Push) notifications
6 participants