Save new request body when retrying the request to save progress#1732
Save new request body when retrying the request to save progress#1732MarceloRGonc merged 6 commits intomainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR modifies the retry logic for flow run update requests to regenerate the request body access key on each retry attempt, ensuring that retries use fresh credentials rather than potentially expired ones.
Key Changes:
- Modified
retryConditionto be async and regenerate the body access key before each retry - Added logic to update the Axios request config with the new body access key when a retry is triggered
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile OverviewGreptile SummaryFixed retry logic to regenerate and save request body with new cache key before each retry attempt, since the original body is deleted from cache after first request processing.
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Engine as Progress Service
participant Cache as Redis Cache
participant API as Internal API
Note over Engine: Initial Request
Engine->>Cache: saveRequestBody(request)
Cache-->>Engine: bodyAccessKey (req:xxx)
Engine->>API: POST /update-run (bodyAccessKey)
API->>Cache: getBufferAndDelete(bodyAccessKey)
Cache-->>API: request body (deleted from cache)
Note over API: Request fails (network/server error)
Note over Engine: Retry Attempt
Engine->>Engine: retryCondition called
Engine->>Cache: saveRequestBody(request)
Cache-->>Engine: newBodyAccessKey (req:yyy)
Engine->>Engine: Update error.config.data
Engine->>API: POST /update-run (newBodyAccessKey)
API->>Cache: getBufferAndDelete(newBodyAccessKey)
Cache-->>API: request body (deleted from cache)
Note over API: Request succeeds
|
|



Fixes OPS-3194.