Q:

Empty context menu - useful or an anti-pattern?

In most areas of our browser-based application, the user gets a context menu when he right-clicks an object. In some areas, there are no actions available for the selected object, therefore a right-click doesn't do anything.
Should we show an empty context menu in that case? (i.e. a menu with one inactive  "no actions available" entry). Our motivation: it might take our application a while to figure out the possible context menu entries for a certain selection. Therefore we added a spinner image to the context menu which indicates its loading state. The user might be confused if nothing is shown after the loading of the menu has completed.

A:

Because the system will take some time to figure out if there are actions available, you can't just remove the contextual menu. This will just confuse users and it will look like the systems is not functioning correctly.
I suggest you go with a menu with a message that says "no actions available for this object".
"No actions available" on its own could still be interpreted as a system failure but "No actions available for this object" explicitly tells the user why there are no other entries in the menu.

