-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport vscode-v1.52.x] fix(deep-cody): Rate limiter synchronizatio…
…n issue (#6378) Follow up on #6366 This PR fixes several issues with the Deep Cody rate limiter implementation: Root Cause Fix: Rate Limit State Synchronization - Fixed race condition in LocalStorageProvider.ts where concurrent Promise.all() usage led to inconsistent state between quota and timestamp storage - Changed to sequential storage operations to ensure timestamp is always saved after quota update - This resolves the core issue where users were locked out due to incorrect time calculations (CODY-4529) ## Test plan - Added precise tests for time-based quota calculations - Enhanced test coverage for various timing scenarios Before this change, the Deep Cody rate limit error would always return the "Retry time" with current time + 24 hours to indicate the current time is being used as the last used time. Submitted at 6:44 ![image](https://github.com/user-attachments/assets/d9b50ff8-bc09-473b-a387-497d1ccbe0c2) Submitted again at 6:45 ![image](https://github.com/user-attachments/assets/e1b0266b-cfbc-40f8-807b-a9d4c93be682) After this change, the "Retry Time" should stick with the last used time until it's been reset after 24 hours. ## Changelog <br> Backport a7339ef from #6377 Co-authored-by: Beatrix <[email protected]>
- Loading branch information
1 parent
da995cb
commit fb81339
Showing
4 changed files
with
39 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters