Skip to content

Conversation

@Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Nov 19, 2025

When ResourceUID::remove_id() is called, the UID cache is removed from memory, but not from the cache file. These entries will be loaded from the cache file into memory the next time the editor is launched, and cannot be removed.

When ResourceUID::update_cache() is called, if the file has only been moved previously, it appends the new entries to the end of the cache file. If the file has been moved repeatedly, this will result in a large number of duplicate entries.

Although we can rely on ResourceUID::clear() to clean up, but ResourceUID::clear() is only called when the editor is launched (during the first scan).

Upon closer examination, retaining these legacy UIDs seems to make sense. For example, if you need to switch between different Git branches. And .godot is generally not tracked by Git.

At its root, the problem is mainly due to insufficient precision in the timestamps of the file's modification time.

When `ResourceUID::remove_id()` is called, the UID cache is removed
from memory, but not from the cache file. These entries will be loaded
from the cache file into memory the next time the editor is launched,
and cannot be removed.

When `ResourceUID::update_cache()` is called, if the file has only
been moved previously, it appends the new entries to the end of the
cache file. If the file has been moved repeatedly, this will result
in a large number of duplicate entries.
@Rindbee Rindbee requested a review from a team as a code owner November 19, 2025 00:37
@AThousandShips AThousandShips added this to the 4.6 milestone Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants