fix(web): exclude sub-folder videos from public space root#1935
Merged
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Paragon Review Skipped Hi @richiemcilroy! Your Polarity credit balance is insufficient to complete this review. Please visit https://app.paragon.run to finish your review. |
| const offset = (page - 1) * PUBLIC_COLLECTION_PAGE_SIZE; | ||
| const where = and( | ||
| eq(spaceVideos.spaceId, collection.id as Space.SpaceIdOrOrganisationId), | ||
| isNull(spaceVideos.folderId), |
There was a problem hiding this comment.
Does spaceVideos.folderId reliably stay NULL for root-level space videos? If there’s a “root folder” record now or in the future, this could unintentionally hide all videos from the root listing. Might be worth a quick regression test covering root vs sub-folder visibility.
Member
Author
|
@greptileai please review the PR |
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.
Excludes videos placed inside sub-folders from the public space root listing, so they are not surfaced before the sub-folder itself is made public.
Greptile Summary
This PR adds a single
isNull(spaceVideos.folderId)predicate to thegetPublicSpaceVideosquery, preventing videos that live inside sub-folders from surfacing in the public space root listing before their parent folder is made public.wherevariable used by both the paginated video list query and the total-count query, keeping them consistent.getPublicOrgFolderVideos,getPublicSpaceFolderVideos,getPublicUserFolderVideos) are affected, as those are all folder-scoped queries and already filter by a specificfolderId.Confidence Score: 5/5
Safe to merge — the change is a single-predicate addition to an existing WHERE clause with no side effects on other query paths.
The fix is narrow and self-contained: one null-check predicate added to a shared
wherevariable that both the video list and count queries already use, so pagination totals stay in sync with the filtered results. The other folder-scoped functions are unaffected. No logic regressions are apparent.No files require special attention.
Important Files Changed
isNull(spaceVideos.folderId)to the WHERE clause ingetPublicSpaceVideosso sub-folder videos are excluded from the space root listing; the fix is applied to the sharedwherevariable, so both the paginated query and the total-count query benefit consistently.Reviews (2): Last reviewed commit: "fix(web): exclude sub-folder videos from..." | Re-trigger Greptile