Repository: voxel51/fiftyone

Issue:
[BUG] App is stuck on "Pixelating.." screen when loading COCO custom dataset.
### Describe the problem

When loading my custom COCO dataset, I cannot launch the app on my Windows PC. The dataset is successfully created, but when I launch the app either in a script or in a jupyter notebook, it remain on the "Pixelating..." screen, even for a sample of 5 images.

### Code to reproduce issue

Provide a reproducible test case that is the bare minimum necessary to generate
the problem. Please avoid sharing code that relies on your local data or
datasets. Include a short video or screenshot if the bug is in the App.

```
import os

import fiftyone as fo
import fiftyone.zoo as foz

# The directory containing the source images
data_path = r"...\data"

# The path to the COCO labels JSON file
labels_path = r"...\val.json"

# Import the dataset
dataset = fo.Dataset.from_dir(
    dataset_type=fo.types.COCODetectionDataset,
    data_path=data_path,
    labels_path=labels_path,
    label_types=["detections"],
    max_samples=1
)

session = fo.launch_app(dataset)
```

### System information

-   **OS Platform and Distribution**: Windows 10
-   **Python version** (`python --version`): 3.8.16
-   **FiftyOne version** (`fiftyone --version`): v0.23.0
-   **FiftyOne installed from** (pip or source): pip

### Other info/logs

![Screenshot 2023-12-07 at 2 32 04 PM](https://github.com/voxel51/fiftyone/assets/53239931/50a7c963-0215-44a0-8875-2de03ad8d1d3)

### Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

-   [ ] Yes. I can contribute a fix for this bug independently
-   [x] Yes. I would be willing to contribute a fix for this bug with guidance
        from the FiftyOne community
-   [ ] No. I cannot contribute a bug fix at this time



Discussion:
Hi @felipe-parodi. Are there any [logs/errors](https://developer.chrome.com/docs/lighthouse/best-practices/errors-in-console) in your browser console that you can share?
Hi @benjaminpkane , thanks for the quick response. No errors in console. i've loaded one test image here:
 
![Screenshot 2023-12-07 at 2 45 49 PM](https://github.com/voxel51/fiftyone/assets/53239931/e0ba205e-b283-4286-aa46-86b157d9861a)

@benjaminpkane just saw a very similar manifestation importing a YOLOv5 dataset in 0.23 with an experienced Teams customer
@felipe-parodi it looks like you connected to an existing session. That is what `Connected to FiftyOne on port 5151 at localhost` indicates. Could an older version of an App session be running?

Clearing your browser cache may help, also
I cleared browser cache and restarted PC but still get the error. When I refreshed the page, I received the following error: TypeError: Error in input stream. Pressing the "x" takes you back to the "Pixelating..." screen. This is on Firefox.

![Screenshot 2023-12-07 at 3 39 36 PM](https://github.com/voxel51/fiftyone/assets/53239931/0d417400-b128-4862-b5ff-8fad3ef3d8d4)

On Chrome/Edge, localhost refuses to connect.


I tested it on mac with the quickstart dataset and v0.23.0 and it leads to the same "PIxelating" screen. All from pip install. will try source install now.
Are you running any plugins? There should definitely be errors in your _browser_ console

Resolving patch:
diff --git a/fiftyone/server/query.py b/fiftyone/server/query.py
--- a/fiftyone/server/query.py
+++ b/fiftyone/server/query.py
@@ -317,6 +317,9 @@ def modifier(doc: dict) -> dict:
         ]
         doc["default_skeletons"] = doc.get("default_skeletons", None)
 
+        # gql private fields must always be present
+        doc.setdefault("frame_collection_name", None)
+
         return doc
 
     @classmethod


Test patch:
diff --git a/tests/unittests/server_tests.py b/tests/unittests/server_tests.py
--- a/tests/unittests/server_tests.py
+++ b/tests/unittests/server_tests.py
@@ -13,8 +13,9 @@
 import fiftyone.core.labels as fol
 import fiftyone.core.odm as foo
 import fiftyone.core.sample as fos
-import fiftyone.server.view as fosv
+from fiftyone.server.query import Dataset
 from fiftyone.server.samples import paginate_samples
+import fiftyone.server.view as fosv
 
 from decorators import drop_datasets
 from utils.groups import make_disjoint_groups_dataset
@@ -894,3 +895,10 @@ async def test_disjoint_groups(self):
         )
         self.assertEqual(len(second_samples.edges), 1)
         self.assertEqual(second_samples.edges[0].node.id, second._id)
+
+
+class ServerDocTests(unittest.TestCase):
+    def test_dataset_doc(self):
+        doc = Dataset.modifier({"_id": "id"})
+        self.assertIn("frame_collection_name", doc)
+        self.assertEqual(doc["frame_collection_name"], None)