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

Add typed events for all user hooks and legacy events #18225

Closed
wants to merge 2 commits into from

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Dec 4, 2019

Update

see #18348


  • Add typed events
  • Emit events where we emitted legacy events and/or hooks
  • Catch new events and re-emit data as legacy events and/or hooks

-> existing code should continue to work, but new code can use the typed events with 18+

  • Session https://docs.nextcloud.com/server/stable/developer_manual/app/hooks.html#session
    • preSetPassword (\OC\User\User $user, string $password, string $recoverPassword)
    • postSetPassword (\OC\User\User $user, string $password, string $recoverPassword)
    • changeUser (\OC\User\User $user, string $feature, string $value)
    • preDelete (\OC\User\User $user)
    • postDelete (\OC\User\User $user)
    • preCreateUser (string $uid, string $password)
    • postCreateUser (\OC\User\User $user)
    • preLogin (string $user, string $password)
    • postLogin (\OC\User\User $user, string $password)
    • logout ()
  • UserManager
    • preSetPassword (\OC\User\User $user, string $password, string $recoverPassword)
    • postSetPassword (\OC\User\User $user, string $password, string $recoverPassword)
    • preDelete (\OC\User\User $user)
    • postDelete (\OC\User\User $user)
    • preCreateUser (string $uid, string $password)
    • postCreateUser (\OC\User\User $user, string $password)

Note: I don't get the diff between Session and UserManager hooks as we always emitted on the manager.

@ChristophWurst ChristophWurst added the 2. developing Work in progress label Dec 4, 2019
@ChristophWurst ChristophWurst self-assigned this Dec 4, 2019
@ChristophWurst ChristophWurst added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Dec 6, 2019
@ChristophWurst ChristophWurst added this to the Nextcloud 18 milestone Dec 6, 2019
@ChristophWurst ChristophWurst marked this pull request as ready for review December 6, 2019 11:58
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

quick 🚬-test
looking good. Lets do this 🚀

@ChristophWurst ChristophWurst force-pushed the enhancement/typed-user-events branch from db3bef7 to 5891d4e Compare December 9, 2019 11:39
@ChristophWurst
Copy link
Member Author

rebased to resolve conflicts

@ChristophWurst
Copy link
Member Author

updated to fix tests

@ChristophWurst ChristophWurst force-pushed the enhancement/typed-user-events branch from 5891d4e to df95437 Compare December 10, 2019 10:18
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

Houston, We have a liftoff 🚀

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Dec 10, 2019
@MichaIng
Copy link
Member

This solves #18331, right?

@ChristophWurst
Copy link
Member Author

This solves #18331, right?

Nope. The uses of the old event are still a problem in some cases. I'll try to have a look at that as well. The problem is that we can't migrate those without introducing a breaking change 😢

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst force-pushed the enhancement/typed-user-events branch from df95437 to 6dfb31a Compare December 10, 2019 13:28
@MichaIng
Copy link
Member

@ChristophWurst
Okay, if it does not cause issues now, hence does not require urgent action, it is probably best to omit those logs, to not flood log files?

@ChristophWurst
Copy link
Member Author

Those logs are fine. You only see them with log minimum log levels set.

We want them to be visible for app developers so they take action timely. On production instances these lines won't show up.

@MichaIng
Copy link
Member

@ChristophWurst
It is currently log level 1 (info) at least, not "minimum" log level 0 (debug). Does it make sense to report it to re individual apps repos then? Not sure how quickly different developers test NC betas 😉.

@ChristophWurst
Copy link
Member Author

It's not just about the apps. As long as we emit the legacy event for BC reasons this info log will be shown.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@rullzer rullzer mentioned this pull request Dec 11, 2019
43 tasks
@ChristophWurst ChristophWurst added 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 4. to release Ready to be released and/or waiting for tests to finish labels Dec 11, 2019
@ChristophWurst
Copy link
Member Author

Can't make CI happy here. #18348 is a simplified version for 18. Cleanup has to follow later.

This was referenced Dec 12, 2019
@gary-kim
Copy link
Member

gary-kim commented Jan 28, 2020

@ChristophWurst Can we close this now?

@gary-kim gary-kim closed this Jan 28, 2020
@ChristophWurst ChristophWurst deleted the enhancement/typed-user-events branch January 28, 2020 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants