Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Static Resource, Asset, CMS Backend Refactor #10304

Merged
merged 81 commits into from
Jun 18, 2024
Merged

Static Resource, Asset, CMS Backend Refactor #10304

merged 81 commits into from
Jun 18, 2024

Conversation

HexaField
Copy link
Member

@HexaField HexaField commented Jun 3, 2024

Summary

  • Remove sid field from static-resource table
  • move getCachedURL and getCacheDomain to storage provider interface
  • Add new fields to static-resource table
  • Change structure of resources.json
  • Remove asset service, in favour of querying for static-resource service with type: "scene"
  • File browser service API now makes project path implicit, and supports projects with slash in the name
  • File browser disallows non-project paths, and non /asset/ or /public/ paths from being accessed
  • Static resources service overhauled to
  • Rewrites file browser tests to be a bit cleaner and less procedural
  • refactored API for projects seeding avatars

Subtasks Checklist

Breaking Changes

References

closes #insert number here

QA Steps

@HexaField HexaField marked this pull request as draft June 15, 2024 03:05
@HexaField HexaField requested a review from barankyle June 17, 2024 21:01
@barankyle
Copy link
Member

I'm still seeing these issues:

When I applied the migration via prepare-database, it seemed to work, but when I created a new scene, it didn't immediately appear in the scene list in the studio; I had to refresh. And when I made further new scenes, I did not see anything even after refreshing. The backend might not be doing that thing where it will append e.g. (1) to the name if it detects it's a duplicate name. If I manually rename New-Scene.gltf, the updated name doesn't appear in the studio unless I refresh. And if I then make a new scene, it gets made as New-Scene.gltf, which is expected, so it's probably the lack of de-duplication that's the problem.

When I ran dev-reinit, all static-resources, even scene files, had type 'file', so no scenes showed up in the studio. And are some of those files supposed to be of type 'asset'? Making a new scene worked, and New-Scene was of type 'scene'.

I also noticed that after dev-reinit, the thumbnail image for scenes in the 'scenes' tab is pointing to the GLTF of the scene, e.g. <img alt="projects/default-project/public/scenes/New-Scene.gltf" crossorigin="anonymous" class="block h-full grow cursor-pointer self-center rounded-t-lg object-cover">. This of course does not render a thumbnail.

@HexaField
Copy link
Member Author

I'm still seeing these issues:

When I applied the migration via prepare-database, it seemed to work, but when I created a new scene, it didn't immediately appear in the scene list in the studio; I had to refresh. And when I made further new scenes, I did not see anything even after refreshing. The backend might not be doing that thing where it will append e.g. (1) to the name if it detects it's a duplicate name. If I manually rename New-Scene.gltf, the updated name doesn't appear in the studio unless I refresh. And if I then make a new scene, it gets made as New-Scene.gltf, which is expected, so it's probably the lack of de-duplication that's the problem.
When I ran dev-reinit, all static-resources, even scene files, had type 'file', so no scenes showed up in the studio. And are some of those files supposed to be of type 'asset'? Making a new scene worked, and New-Scene was of type 'scene'.

I also noticed that after dev-reinit, the thumbnail image for scenes in the 'scenes' tab is pointing to the GLTF of the scene, e.g. <img alt="projects/default-project/public/scenes/New-Scene.gltf" crossorigin="anonymous" class="block h-full grow cursor-pointer self-center rounded-t-lg object-cover">. This of course does not render a thumbnail.

Due to changes in how dev-reinit works in this branch, you may need to remove and prune the docker image of the db, checkout dev & reinit, and then checkout this branch and prepare-database. If this is what you have been doing, then we may need to sync up to figure this out.

@HexaField HexaField marked this pull request as ready for review June 17, 2024 21:27
@barankyle
Copy link
Member

I'm still seeing these issues:

When I applied the migration via prepare-database, it seemed to work, but when I created a new scene, it didn't immediately appear in the scene list in the studio; I had to refresh. And when I made further new scenes, I did not see anything even after refreshing. The backend might not be doing that thing where it will append e.g. (1) to the name if it detects it's a duplicate name. If I manually rename New-Scene.gltf, the updated name doesn't appear in the studio unless I refresh. And if I then make a new scene, it gets made as New-Scene.gltf, which is expected, so it's probably the lack of de-duplication that's the problem.
When I ran dev-reinit, all static-resources, even scene files, had type 'file', so no scenes showed up in the studio. And are some of those files supposed to be of type 'asset'? Making a new scene worked, and New-Scene was of type 'scene'.

I also noticed that after dev-reinit, the thumbnail image for scenes in the 'scenes' tab is pointing to the GLTF of the scene, e.g. <img alt="projects/default-project/public/scenes/New-Scene.gltf" crossorigin="anonymous" class="block h-full grow cursor-pointer self-center rounded-t-lg object-cover">. This of course does not render a thumbnail.

Due to changes in how dev-reinit works in this branch, you may need to remove and prune the docker image of the db, checkout dev & reinit, and then checkout this branch and prepare-database. If this is what you have been doing, then we may need to sync up to figure this out.

Wouldn't this permanently minorly break local development if dev-reinit no longer works as intended?

@HexaField
Copy link
Member Author

Wouldn't this permanently minorly break local development if dev-reinit no longer works as intended?

Hanzla and I agreed these changes are correct. Currently, the knex migrations are not wiped when reinitting, leading to migrations not running as expected. This nukes all tables and ensures all migrations always run as needed.

@HexaField
Copy link
Member Author

@barankyle addressed all your feedback

@HexaField HexaField merged commit abe0e11 into dev Jun 18, 2024
28 checks passed
@HexaField HexaField deleted the cms-refactor branch June 18, 2024 22:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants