* [misc] freeze time before any other unit test setup steps
Freezing it after other work (notably sandboxed-module imports) will
result in flaky tests.
* [web] update the projects lastUpdated timestamp when changing file-tree
GitOrigin-RevId: b82b2ff74dc31886f3c4bd300375117eead6e0cd
* Fix `fix_malformed_filetree`'s `fixName`
* Fix findUniqueName with missing names in siblings
* Add test showcasing another bug: shifted arrays in filetree folder
* Update `removeNulls` to use `_id`
* Update services/web/app/src/Features/Project/ProjectLocator.js
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
* Add FIXME about file names uniqueness
* Rename `obj` to `project`
---------
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 3ed795ae0621800603395f7b50626ac89c39199d
* Create tests on find_malformed_filetrees and fix_malformed_filetrees
* Remove lines that are making fix_malformed_filetree fail
These lines are causing errors such as
```
Missing file hash: 586846800000000000000000/5891271c0000000000000000 (rootFolder.0.folders.2.fileRefs.7.hash)
SaaS: likely needs filestore restore
Server Pro: please reach out to support
```
* Add snapshots of projects after fix_malformed_filetree
* Set `WRITE_SNAPSHOT` as false
* Make `deleteProjectsRecordId0` constant
* Ignore duplicated ID errors in CreateMalformedFileTrees.mjs
* Move snapshots to directory folder
* Remove unnecessary code
* Update tests to cover use cases from the scripts
* Fix: Use `new ObjectId(projectId)` instead of the string in mongo queries
* Fix: Query `rootFolder: []` to fix more than `rootFolder: { $size: 0 }`
* Remove/rename files from first draft
* Remove empty strings from expects in unrelated tests, now that `filterOutput` removes them
* Add missing `expectFixStdout` to tests
* misc: rename test util to strId
* Add "well formed filetrees" to test cases
* Use `wellFormed` variable to remove some duplication
* Update tests:
- check Missing file hash path
- remove test on string/numbers as array items
* Add test "bug: shifted arrays in filetree"
* Rename `wellFormedFile` to `wellFormedFolder`
* Fix name of the root folder to `'rootFolder'`, not `'untitled'`
GitOrigin-RevId: dc098bb7ad3ca441fe2bb72b5f5f0e3bcedbdf67
- Validate _id fields to be ObjectIds
- Include more debug output, notably include the folder/doc/file id
- Emit and consume JSON output
- Read broken file-tree details from (ad-hoc) file
- Use generator instead of accumulating all results per project first
- Use batchedUpdate to be able to pause and resume processing
GitOrigin-RevId: 606ac431fff65891e09479c0ba9bcb7e7dc5cbe4