Reuse today's ROI fetch result in incremental path#14
Open
yoshi-taka wants to merge 1 commit into
Open
Conversation
This updates the incremental ROI path to reuse the earlier fetch of today's executions when a job is confirmed to have ROI data. The flow still performs the initial ROI status check and keeps the existing control flow, but it now carries the first today-result forward instead of issuing the same request again later. That keeps the diff small, stays close to the current design intent, and reduces unnecessary server calls for jobs that already need today's ROI check.
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.
Summary
Avoid fetching today's executions twice for the same job in the incremental ROI update path.
This change keeps the current flow mostly intact, but reuses the result from the earlier "today" fetch when the job is already confirmed to have ROI data.
Background
getExecutionsWithRoi()has an incremental path for users who already have ROI state in the browser.In the current flow, the same job can fetch today's executions twice:
That creates an unnecessary extra request even though the first result is still usable.
What changed
This PR makes a small, localized change:
This keeps the existing control flow and behavior largely unchanged, while avoiding the duplicate request.
Why this approach
An alternative would be to remove the earlier fetch and rely only on the later common path, but the current structure and comments suggest that earlier ROI-aware step is part of the intended flow.
Reusing the first result preserves that structure, keeps the diff small, and avoids changing the broader cache / discovery behavior.
Expected impact
User-facing impact:
Technical impact:
fetchExecutions(jobId, todayDateRange)call for jobs where the earlier ROI-aware path already fetched today's dataRisk
Risk should be low because:
The main thing to watch is whether any edge case implicitly depended on the second request being issued separately, even when the same "today" data had already been retrieved.
Testing
Not fully verified with automated tests in this repo.
Manual verification target: