René's URL Explorer Experiment


Title: feat(files): page, search, look up and roll up workspace files over the session API by waleedlatif1 · Pull Request #9435 · simstudioai/sim · GitHub

Open Graph Title: feat(files): page, search, look up and roll up workspace files over the session API by waleedlatif1 · Pull Request #9435 · simstudioai/sim

X Title: feat(files): page, search, look up and roll up workspace files over the session API by waleedlatif1 · Pull Request #9435 · simstudioai/sim

Description: Summary Server side of workspace-file pagination: bounded pages, search, batched lookup and folder rollups over the session API, so clients no longer need the whole workspace list. Paged list: GET /api/workspaces/[id]/files takes folderId (root or an id; direct children), sortBy (name | size | uploadedAt | updatedAt), sortOrder, limit (≤500) and cursor, and returns { files, nextCursor }; with no paging params it returns the unchanged full response, so existing clients keep working during rollout. Cursors are bound to the route, workspace, scope and folder Search: GET .../files/search?q&folderId&recursive&limit — case-insensitive name search (LIKE-escaped), optionally over a folder's subtree, with folderPath Lookup: POST .../files/lookup { ids, keys, references } — one query for up to 100 of each, deduplicated Folder stats: GET .../files/folder-stats?parentId — file count and bytes per direct child folder, over its subtree, from one grouped aggregate One shared page implementation (readWorkspaceFilePage) behind the session API, v2 and the mothership VFS The folder filter is written as coalesce(folder_id, '') = $f, so folder pages seek the existing folder-name index instead of scanning every live file; name pages seek on the cursor uploadedAt/updatedAt keysets order on the plain column with microsecond cursors (matching the indexes); a cursor minted before this resumes on the old millisecond ordering, via a resumableTimestampKey helper shared with the logs API Migration 0443: (workspace_id, coalesce(folder_id, ''), uploaded_at, id) for folder pages in upload order and a trigram GIN on original_name for search, both partial on live workspace files and built concurrently; content edits stay HOT Type of Change New feature Other: performance Testing Integration (real Postgres, migrate- and push-provisioned): every sort in both directions across ties (including timestamps that differ only below the millisecond), legacy millisecond cursor resume, root/folder/recursive scopes, foreign or unknown folders, deleted/archived/chat-upload exclusion, empty folder id refused, search (case, subtree, limit, literal wildcards), lookup (ids/keys/references, foreign and deleted ignored), nested folder rollups, authorization (read member served, non-member forbidden) Plan assertions on the SQL the managers send: workspace-wide upload-order pages use the upload-order index with no sort, folder pages the folder index, name pages the name index, search the trigram index Route tests: the unpaged response is unchanged; a cursor reused under another folder is refused bun run check:migrations origin/staging, drizzle-kit generate (no changes), bun run lint, bun run check:audits, bun run type-check Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Server side of workspace-file pagination: bounded pages, search, batched lookup and folder rollups over the session API, so clients no longer need the whole workspace list. Paged list: GET...

X Description: Summary Server side of workspace-file pagination: bounded pages, search, batched lookup and folder rollups over the session API, so clients no longer need the whole workspace list. Paged list: GET...

Opengraph URL: https://github.com/simstudioai/sim/pull/9435

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:3bfea68f-3b55-95b8-0d57-e6156cb2f162
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD8B8:C9B09:3B279:56712:6AFB099F
html-safe-noncee508e77a3a7e874bed6871732419a9e78e07527a0d40ba7e6d3b811cb45a56b8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOEI4OkM5QjA5OjNCMjc5OjU2NzEyOjZBRkIwOTlGIiwidmlzaXRvcl9pZCI6IjY0MDU4ODU2OTAxODA3MzMzNDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac044c272823ac36bd6a47fe2040af40ba4e00cbd5aad369613124429106a42ef1
hovercard-subject-tagpull_request:5061564987
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/9435/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Server side of workspace-file pagination: bounded pages, search, batched lookup and folder rollups over the session API, so clients no longer need the whole workspace list. Paged list: GET...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None76fb13cb43f1834708971f45a9cfcab5df3177a7582086613d7cdc6e98c4bfde
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseafc998826cdd963c8f91a96ae5372809ab5e296b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9435/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9435%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9435%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/9435/files
Reloadhttps://github.com/simstudioai/sim/pull/9435/files
Reloadhttps://github.com/simstudioai/sim/pull/9435/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
perf/files-list-apihttps://github.com/simstudioai/sim/tree/perf/files-list-api
Conversation 25 https://github.com/simstudioai/sim/pull/9435
Commits 7 https://github.com/simstudioai/sim/pull/9435/commits
Checks 67 https://github.com/simstudioai/sim/pull/9435/checks
Files changed https://github.com/simstudioai/sim/pull/9435/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9435/files
feat(files): page, search, look up and roll up workspace files over the session API https://github.com/simstudioai/sim/pull/9435/files#top
Show all changes 7 commits https://github.com/simstudioai/sim/pull/9435/files
d4b7c86 perf(files): seek folder indexes and order file timestamps on the raw… waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/d4b7c86457b3c2414b398c5f0fc80abc000a58fe
ab271d9 feat(files): page, search, look up, and roll up workspace files over … waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/ab271d949ec3290d4ffac7a170dfff4966491cb2
41ce612 refactor(files): simplify the paged file reads and share their helpers waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/41ce6126db66ccbe5764d30ed1f187003cba108c
70087bf refactor(files): trim restating comments and duplicate file-listing t… waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/70087bf566a5f931bb456dda3ea8ca5afdf259cf
63e3e15 fix(files): read the root's folder stats when parentId is omitted waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/63e3e15e2bc6a78848225e7b8a90e8f4372e71b3
5c71b3b fix(files): read a reference that is not valid encoding as a bare name waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/5c71b3b920cec1b6277d1adcc9c04a6123286220
b6c80de perf(db): index live workspace files by folder upload date and name t… waleedlatif1 Oct 29, 2026 https://github.com/simstudioai/sim/pull/9435/commits/b6c80dedfae71de44a97a4abb7b369691b47be0e
Clear filters https://github.com/simstudioai/sim/pull/9435/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9435/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9435/files
route.test.ts https://github.com/simstudioai/sim/pull/9435/files#diff-98a0c66986526dd4d6b9ff1ee12b9aeca32c6316af7a2f558a0b3030d41a700c
route.ts https://github.com/simstudioai/sim/pull/9435/files#diff-2f91dd2aa53cb6689aea1cd65b1187ef29855618830e84de802bba0a679835e4
route.ts https://github.com/simstudioai/sim/pull/9435/files#diff-a2942feb022d3081aef9fccff40681bc4c8be5787942fabfa6d496c8e859f898
route.test.ts https://github.com/simstudioai/sim/pull/9435/files#diff-3f84aaf5931fc4695cd2b8dd183efae7094527b2bec106ff681ba04dfad01d28
route.ts https://github.com/simstudioai/sim/pull/9435/files#diff-ffd1644c9109b4913147a4bd6d6c620ed49c7c38cb0c8cfddf4c9f2c5fe55867
route.ts https://github.com/simstudioai/sim/pull/9435/files#diff-698e64d9b0e799a740a7e12c19107aa0afed54a8ece61d9b1fcf038344bcaa4c
workspace-files.ts https://github.com/simstudioai/sim/pull/9435/files#diff-05f84543b5a8f478260ff33a6503250494619411c41c9f43523e352d8fe8bc37
list-query.ts https://github.com/simstudioai/sim/pull/9435/files#diff-32aecd996eadcd96f7be5ec1b731ed5e4221e4d9114ed295dbaa5f5fb13648f0
public-queries.ts https://github.com/simstudioai/sim/pull/9435/files#diff-57e27427633a23e96c03079344c9fbb124cbe4dc3d0959a765030d69027b7100
attach.ts https://github.com/simstudioai/sim/pull/9435/files#diff-ee7db30553c1e049a5590fad95c417d5c2afe0c3f37157e7294d5afa048a0da0
file-manager.ts https://github.com/simstudioai/sim/pull/9435/files#diff-8a5fe21cb59e40994be235c3a799fe7cf265576f7480174d6df727af5a7bf644
path.ts https://github.com/simstudioai/sim/pull/9435/files#diff-a250e59981b276e052283d10ec3953d262cbfd38e904b3bd1d365af8a8ed2c75
file-listing-plans.integration.ts https://github.com/simstudioai/sim/pull/9435/files#diff-c0a7baf31686a2b5eca68686afe33be42b947ca648be2703954ac6c62584aa5c
file-listing.integration.ts https://github.com/simstudioai/sim/pull/9435/files#diff-f32775fb7adda2b1d93ebbfa218f14bf471b00fa9e01afe430dd6966d31ee667
list-workspace-files.ts https://github.com/simstudioai/sim/pull/9435/files#diff-c0043b079185e91389f3f511826ca09eada23b70ef9e58e3d610a012ac3396e6
queries.ts https://github.com/simstudioai/sim/pull/9435/files#diff-b9449dedfdaeab35cba403bbbffde318c75822f166d7ce8f60a68c0183443582
query-scope.ts https://github.com/simstudioai/sim/pull/9435/files#diff-6d116bde98b633b603b0ca8c1aa029b938dd367cb4ceddb5fa51d7a584feb8b2
0443_workspace_file_folder_upload_and_name_search_idx.sql https://github.com/simstudioai/sim/pull/9435/files#diff-2bfe2943534c24929a63de16e39a70cf9f112426062a478b2237a2f2e40d8743
0443_snapshot.json https://github.com/simstudioai/sim/pull/9435/files#diff-a7aa9ea32d00b745d96f246cc1bda96ec81eb0e580955cf676c593afd083ba1d
_journal.json https://github.com/simstudioai/sim/pull/9435/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
schema.ts https://github.com/simstudioai/sim/pull/9435/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
explain.ts https://github.com/simstudioai/sim/pull/9435/files#diff-3451bc7f5ca17320150a86318e313f926a5011e2b31d1fa9c7904d1515b7b142
workspace-files-list.mock.ts https://github.com/simstudioai/sim/pull/9435/files#diff-6c7d83280c780f86b42d2920c2fc03795bcb67d9b2ca78ca01556befe85e3d4c
apps/sim/app/api/workspaces/[id]/files/folder-stats/route.test.tshttps://github.com/simstudioai/sim/pull/9435/files#diff-98a0c66986526dd4d6b9ff1ee12b9aeca32c6316af7a2f558a0b3030d41a700c
View file https://github.com/simstudioai/sim/blob/b6c80dedfae71de44a97a4abb7b369691b47be0e/apps/sim/app/api/workspaces/%5Bid%5D/files/folder-stats/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9435/{{ revealButtonHref }}
apps/sim/app/api/workspaces/[id]/files/folder-stats/route.tshttps://github.com/simstudioai/sim/pull/9435/files#diff-2f91dd2aa53cb6689aea1cd65b1187ef29855618830e84de802bba0a679835e4
View file https://github.com/simstudioai/sim/blob/b6c80dedfae71de44a97a4abb7b369691b47be0e/apps/sim/app/api/workspaces/%5Bid%5D/files/folder-stats/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9435/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/9435/files
apps/sim/app/api/workspaces/[id]/files/lookup/route.tshttps://github.com/simstudioai/sim/pull/9435/files#diff-a2942feb022d3081aef9fccff40681bc4c8be5787942fabfa6d496c8e859f898
View file https://github.com/simstudioai/sim/blob/b6c80dedfae71de44a97a4abb7b369691b47be0e/apps/sim/app/api/workspaces/%5Bid%5D/files/lookup/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9435/{{ revealButtonHref }}
apps/sim/app/api/workspaces/[id]/files/route.test.tshttps://github.com/simstudioai/sim/pull/9435/files#diff-3f84aaf5931fc4695cd2b8dd183efae7094527b2bec106ff681ba04dfad01d28
View file https://github.com/simstudioai/sim/blob/b6c80dedfae71de44a97a4abb7b369691b47be0e/apps/sim/app/api/workspaces/%5Bid%5D/files/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9435/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9435/files#diff-3f84aaf5931fc4695cd2b8dd183efae7094527b2bec106ff681ba04dfad01d28
https://github.com/simstudioai/sim/pull/9435/files#diff-3f84aaf5931fc4695cd2b8dd183efae7094527b2bec106ff681ba04dfad01d28
https://github.com/simstudioai/sim/pull/9435/files#diff-3f84aaf5931fc4695cd2b8dd183efae7094527b2bec106ff681ba04dfad01d28
https://github.com/simstudioai/sim/pull/9435/files#diff-3f84aaf5931fc4695cd2b8dd183efae7094527b2bec106ff681ba04dfad01d28
apps/sim/app/api/workspaces/[id]/files/route.tshttps://github.com/simstudioai/sim/pull/9435/files#diff-ffd1644c9109b4913147a4bd6d6c620ed49c7c38cb0c8cfddf4c9f2c5fe55867
View file https://github.com/simstudioai/sim/blob/b6c80dedfae71de44a97a4abb7b369691b47be0e/apps/sim/app/api/workspaces/%5Bid%5D/files/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9435/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9435/files#diff-ffd1644c9109b4913147a4bd6d6c620ed49c7c38cb0c8cfddf4c9f2c5fe55867
https://github.com/simstudioai/sim/pull/9435/files#diff-ffd1644c9109b4913147a4bd6d6c620ed49c7c38cb0c8cfddf4c9f2c5fe55867
apps/sim/app/api/workspaces/[id]/files/search/route.tshttps://github.com/simstudioai/sim/pull/9435/files#diff-698e64d9b0e799a740a7e12c19107aa0afed54a8ece61d9b1fcf038344bcaa4c
View file https://github.com/simstudioai/sim/blob/b6c80dedfae71de44a97a4abb7b369691b47be0e/apps/sim/app/api/workspaces/%5Bid%5D/files/search/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9435/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/9435/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9435/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.