Items not yet fixed from the full audit. Organized by repo.
- N+1 in
directory_jsonfile_count — Each directory triggers a separate COUNT query in index. Fix: counter_cache or preloaded counts with subquery. (app/controllers/api/v1/directories_controller.rb) - N+1 in
UserDirectory#path_display— Recursive parent loading for path construction. O(depth × N) queries on manifest endpoint. Fix: materialized path column. (app/models/user_directory.rb:33-43) changesAPI limit logic bug —fetch_file_changesqueries both active AND deleted with same limit, so actual count can be up to 2× limit.has_morecan give false positives causing sync clients to loop. (app/controllers/api/v1/sync_controller.rb:10-23)