Week Log 2
A project journal
🎨 A bump on the road towards hiding hidden projects
8th December 2020
I wrote some code to remove hidden projects and all their data, and discovered that it broke everything. Entries, efforts and downloads are retrieved by array index, and of course deleting elements will change the indexing.
We use array index all over the codebase, so changing the lookup approach is impractical for now. I think a better approach might be to reindex the entries in the project. Looking at LoadData
, it seems we already do this in one instance. Since the index values are used for further projects, we'll have to do this straight after removing entries for a hidden project.
With a bit of luck we'll be able to extract some indexing code from LoadData
and create another service object that can do the work in multiple places. Let's give it a shot.