* Fix error when users table does not exist
In multitenant context, when schema is switched to and the tables are
not created yet, getting `User.current` will fail with
ActiveRecord::StatementInvalid:"PG::UndefinedTable: ERROR: relation \"users\" does not exist" [...]
To prevent it, check if the table exists first and return `nil` if not.
* Avoid logging "slow sql" for database creation
* Better performance for handling unexisting users table
Checking multiple times the users table existence when something is
logged is probably a bad idea. Better rescue errors.
Also cache the return value of `#current_user` to call the method only
once.
We already get an exception and backtrace, but there's no
well-documented way to add this to an event, so I suggest to use
captureException instead.
https://community.openproject.org/wp/39012
* Bump Sentry and implement log handling in core
* Manually insert the sentry middlewares
* Also add user locale as tags
* Add performance tracing
* Update sentry host to sentry2
* Update frontend sentry-reporter to the new sdk
* Silence delayed_job's own logger since activejob logs already
Delayed::Job will otherwise always log all arguments, which we disable by design
* Remove default sentry host
Creates a new warning bar (previously top-shelf item) that renders a
warning when migrations are pending. These did raise exceptions before
in production and would result in users running in internal errors due
to pending migration on some actions on the instance.
https://community.openproject.com/wp/29253