mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:03:43 +08:00
DEV: Don't print warning about attempt to track status of a user without id in tests (#23228)
It is hard to catch and debug potential bugs related to live updates of
user status (though, we haven't seen many such bugs so far). We have
this `console.warn` statement that should help us to catch one class of
such bugs:
70f1cc5552/app/assets/javascripts/discourse/app/models/user.js (L1384-L1389)
But in tests, we quite often operate with stubs of users that don't have ID,
and this warning create unnecessary noise. This PR disable the warning in
the testing environment.
This commit is contained in:
parent
1e59e18ad2
commit
c519d60d50
|
@ -1381,7 +1381,7 @@ User.reopen(Evented, {
|
|||
|
||||
// always call stopTrackingStatus() when done with a user
|
||||
trackStatus() {
|
||||
if (!this.id) {
|
||||
if (!this.id && !isTesting()) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
"It's impossible to track user status on a user model that doesn't have id. This user model won't be receiving live user status updates."
|
||||
|
|
Loading…
Reference in New Issue
Block a user