fix: filter archived sessions from per-project session list#27034
Open
bingkxu wants to merge 1 commit into
Open
fix: filter archived sessions from per-project session list#27034bingkxu wants to merge 1 commit into
bingkxu wants to merge 1 commit into
Conversation
listByProject() was returning all sessions including archived ones, while listGlobal() already filtered them. Added isNull(time_archived) filter to match listGlobal behavior. Closes anomalyco#27030
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one highly relevant PR that addresses a very similar issue: Potential Duplicate:
This PR (#27034) may be addressing the same bug or a follow-up fix specific to the per-project listing. You may want to check if PR #24907 already covers this functionality or if this is a separate oversight in the per-project listing that was missed in the previous fix. |
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.
Issue for this PR
Closes #27030
Type of change
What does this PR do?
The per-project session listing (
Session.list()/GET /session) returns all sessions including archived ones, while the global listing (Session.listGlobal()/GET /experimental/session) already filters out archived sessions viaisNull(time_archived).This causes archived sessions from automated workflows (cron tasks, CI runs) to pollute the session history displayed to users.
Fix: Added
isNull(SessionTable.time_archived)filter condition tolistByProject()function to matchlistGlobal()behavior. Also addedarchived?: booleanoption toListInputtype so callers can optionally include archived sessions.How did you verify your code works?
bun typecheckinpackages/opencode- no new type errorsScreenshots / recordings
N/A (backend change, no UI impact)
Checklist