Race condition in compound assignment JS-0040
Bug risk
Major
a year ago2 years old
Possible race condition: notification might be reassigned based on an outdated value of notification
460  } else {
461    if(cansendNoti) {
462      let notification = new Notification('IPost', { body: "new message posted from " + user , tag: "new_post"});
463      notification = await notification464      notification.addEventListener("click",function(){
465        notification.close()
466      })
Possible race condition: user_cache[username] might be assigned based on an outdated state of user_cache
132    } else {
133      user = "/images/default_avatar.png"
134    }
135    user_cache[username]=user136  }
137  return user
138}
Possible race condition: notification might be reassigned based on an outdated value of notification
368  } else {
369    if(cansendNoti) {
370      let notification = new Notification('IPost', { body: "new dm from " + user , tag: "new_post"});
371      notification = await notification372      notification.addEventListener("click",function(){
373        notification.close()
374      })