Let's spend some time fixing our application's potential performance problems. According to the warning, we need to add an index for the group field in the /messages list. Let's get started:
- Switch to the Firebase console and click the Rules tab of the Database section.
- Update the rules, as shown in the following screenshot:
- Once you are ready, press the Publish button. At this point, Firebase builds an index and updates the data. You don't need to perform any extra steps at the client-side.
- Reload the page and check out the console's output.
- This time, you should see no performance warnings:
That's all when it comes to performance tuning our messages list. Now, let's learn how to implement the message editor.