Retry locked user settings files during secure screen copy (#21090)
Link to issue number:
Fixes #20118
Summary of the issue:
Copying user settings for use during sign-in and on secure screens can fail when one configuration file is temporarily locked. The reported log showed Windows error 33 while copying an AIAssistant database. installer.tryCopyFile made only one initial copy attempt, so the entire settings copy stopped before a temporary lock could clear.
Description of user facing changes:
NVDA now makes up to six initial copy attempts, 0.5 seconds apart. If a temporary lock clears during that period, the requested settings copy can finish and report success. A file that remains unavailable after all attempts still produces the existing error.
No dialogs, settings, or translatable strings were changed.
Description of developer facing changes:
installer.tryCopyFile now accepts optional retry-count and retry-interval parameters. Its existing-destination overwrite fallback remains unchanged.
Four unit tests cover:
Immediate success without sleeping.
Temporary failures followed by success.
Exhausted attempts raising the copy error.
Existing-destination overwrite behavior without retrying.
A bug-fix entry was added to user_docs/en/changes.md.
Description of development approach:
I reproduced the reported error code with a controlled byte-range lock on a user-configuration file. The same file copied normally when unlocked and after the lock was released.
I added failing retry tests before changing tryCopyFile, then implemented the bounded retry around its initial copy path. The final coverage includes the normal copy, temporary failures followed by success, exhausted attempts, and the existing-destination overwrite path.