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.
Run page links to tasks & replay run modal improvements #1364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run page links to tasks & replay run modal improvements #1364
Changes from all commits
0ebd79e
b18129a
77455f3
77bd829
35bb7a2
701d5af
5a33a00
8425361
84c38c1
28af219
d538eca
7932a05
4ee4963
be23df4
3953e8b
9b1c664
ae9adb5
ba0ec21
ba60cb6
50d5680
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
LGTM: Well-implemented custom hook with a minor optimization suggestion.
The
useReplaceSearchParams
hook is well-implemented, providing a clean API for managing search parameters. The use ofuseCallback
for memoization is a good practice. However, there's a minor optimization that can be made:Consider removing
searchParams
from theuseCallback
dependency array:This change is safe because
setSearchParams
always provides the most up-to-datesearchParams
object, and removingsearchParams
from the dependency array can prevent unnecessary re-renders.📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential performance issue: Consider implementing pagination or limiting the results for
triggeredRuns
.Fetching all
triggeredRuns
without a limit might lead to performance issues if there are many triggered runs associated with a span. To prevent potential delays or excessive memory usage, it's advisable to implement pagination or set a reasonable limit on the number of results returned.Apply this diff to add a limit to the query:
const triggeredRuns = await this._replica.taskRun.findMany({ select: { friendlyId: true, taskIdentifier: true, spanId: true, createdAt: true, number: true, lockedToVersion: { select: { version: true, }, }, }, where: { parentSpanId: spanId, }, + take: 100, // Limit the results to 100 });
Alternatively, consider adding pagination parameters to the query to allow clients to request specific ranges of results.
📝 Committable suggestion