vaadin / collaboration-engine

The simplest way to build real-time collaboration into web apps
https://vaadin.com/collaboration
Other
3 stars 1 forks source link

CollaborationAvatarGroup should display own avatar when isOwnAvatarVisible is true #15

Closed pekam closed 3 years ago

pekam commented 3 years ago

Describe the bug Consider having a CollaborationAvatarGroup with isOwnAvatarVisible() == true, and the component fails to connect to CE. This means that the avatars of other potential users can not be rendered. In this situation, the component should still display the user's own avatar.

The component may fail to connect to CE if the number of monthly end users has exceeded the license quota. Once we have CE running as a standalone server, it's also possible to have actual technical/network failures that prevent the app server from connecting to CE.

To Reproduce Steps to reproduce the behavior:

  1. Add a CollaborationAvatarGroup to a view and set a topic to it
  2. Start the app and open it as enough users to exceed the entire quota (including the grace period quota).
  3. Open the form as one more user.
  4. Notice how the avatar group is empty.

Expected behavior The avatar group should still display the user's own avatar.

Versions

Technical details and solution proposal This bug is similar to #13, and could be also fixed with a handler for failed topic connections #14. However, in the case of this component, we can simply set the avatars to have only the local user's avatar in setTopic. If the topic connection succeeds, the avatars will be overridden to contain the avatars of all the users. If not, the user's own avatar will remain visible. If the topic id is null, own avatar is displayed immediately.