fix(cli): validate fps upper bound, prune stale sessions, add upload progress, retry desktop store read#1887
Open
ManthanNimodiya wants to merge 3 commits into
Open
Conversation
…progress, retry desktop store read
…ce, and credential retry logic
Contributor
Author
|
@greptileai please re-review |
Contributor
Author
|
@greptileai please re-review |
Contributor
Author
|
@richiemcilroy, addressed all the comments of greptile, lmk for any changes |
Member
|
@greptileai please re-review |
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.
Addresses 4 issues found in #1886:
Greptile Summary
This PR addresses four issues identified in the previous review: FPS upper-bound validation, stale session pruning, upload progress reporting, and retry logic for the Desktop credential store read.
record.rs:--fpsnow rejects values outside 1–120 with a clear error message.session.rs: Stopped/Error sessions older than 7 days are pruned on the nextsessions_dir()call; the previous infinite-recursion issue is resolved by building deletion paths directly from the knowndirargument.upload.rs: A background task emitsUploadingprogress events every second;task.abort()is now correctly placed beforesend_result?so the task is torn down on both network errors and successful uploads beforeUploadedis written.credentials.rs: Retries up to 3× for truncated JSON; returns early from the closure on a successful parse (whether or not auth is present), eliminating unnecessary 100 ms delays for logged-out users.Confidence Score: 5/5
Safe to merge; the four targeted fixes are implemented correctly and the changes are narrowly scoped.
All four previously reported defects are correctly addressed. The remaining observations are efficiency and edge-case concerns (redundant prune scans per operation, immediate deletion of sessions whose started_at is absent) that don't affect normal operation.
apps/cli/src/session.rs — the prune-on-every-sessions_dir() design causes multiple redundant directory scans per write/cleanup operation, and sessions without a started_at timestamp are pruned immediately rather than conservatively retained.
Important Files Changed
is_some_and; error message updated to reflect the 1–120 range.dir. However,sessions_dir()is called multiple times per high-level operation, triggering multiple redundant prune scans. Sessions missingstarted_atare treated as infinitely old and pruned immediately.send_result?, ensuring the progress task is torn down on both network errors and success paths beforeUploadedis emitted.Reviews (4): Last reviewed commit: "fix(cli): abort upload progress task on ..." | Re-trigger Greptile