Repository navigation
Conversation
Reuse successful server public key responses for ten minutes, scoped to the server URL and current user certificate. Keep certificate verification on every entry and merge concurrent cache misses. Assisted-by: Codex:GPT-6 Signed-off-by: Li Wei <caeser222000@sohu.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repeatedly opening encrypted folders downloads the E2EE server public key on every entry. The server-key endpoint's default limit of six requests per ten minutes can therefore block normal folder browsing with HTTP 429.
Share successful, non-empty server public key responses in an in-memory cache for ten minutes, using a monotonic clock and synchronizing concurrent requests. Cache entries are scoped to the complete server URL and freshly fetched user certificate, so certificate changes trigger a new download. Failed and empty responses are not cached. User certificates are still fetched and verified on every check; folder metadata and signature validation remain unchanged. Resolve clients through ClientRepository and adapt the existing encrypted-folder integration test setup to the injected dependencies.
Validation on this branch:
lintGplayDebugpassed with no errors or warnings.AI disclosure: Codex (GPT-6) assisted with implementation, tests and analysis.