René's URL Explorer Experiment


Title: improvement(perf): bound trash, file-path and attachment reads by waleedlatif1 · Pull Request #8945 · simstudioai/sim · GitHub

Open Graph Title: improvement(perf): bound trash, file-path and attachment reads by waleedlatif1 · Pull Request #8945 · simstudioai/sim

X Title: improvement(perf): bound trash, file-path and attachment reads by waleedlatif1 · Pull Request #8945 · simstudioai/sim

Description: Summary Recently Deleted reads one bounded page at a time. The settings page loaded every archived workflow, folder, table, knowledge base, file, file folder and chat in full (tables also ran a per-row size subquery and a jobs lookup) and then searched and sorted in memory. It now calls a new GET /api/workspaces/[id]/recently-deleted, which returns 50 rows per page with keyset pagination. Each type's query is limited to limit + 1 rows, in page order, using its (workspace_id, deleted) partial index. The query reads one UNION ALL of those per-type queries and only the columns the list renders. Search and sort run on the server and the UI scrolls infinitely. Ties still break name then id, A→Z, in either direction. Authorization runs in a new application use case: workspace read, then each type's own list capability (a withheld capability hides that type and its folders), and chats only for the viewer's own. Existing per-type endpoints, the v2 API and other UI are unchanged. Copilot path lookups no longer list every workspace file. run_code file mounts and the file-preview target resolution now share one batched candidate query (findListedWorkspaceFiles, built on the display-name index candidate query) under the same files.list authorization. It keeps the listing's exact matching rules. Directory mounts page the folder subtree in SQL and are capped at the mount limit. Chat attachment reads no longer load the transcript. read_attachment reads only the fileAttachments entries whose id or filename matches, through the same lateral-array pattern as the MCP server lookup. KeysetKey gains an optional fixed direction for ascending tiebreakers, and keysetOrderBy, so the trash reuses the shared keyset engine. useLoadMoreSentinel is extracted from Resource and shared. Type of Change Improvement (performance) Testing New integration suites run in CI: lib/workspaces/__integration__/recently-deleted.integration.ts: per-type predicates, page walks at limits 1/2/3 equal the unpaged order for every sort, microsecond page boundaries, search escaping, type narrowing, cursor validation. lib/mothership/chat/file-attachments.integration.ts: equivalence with the transcript scan, malformed entries, deleted messages. A new case in file-names.integration.ts checks that the batched and single lookups pick exactly the file the full listing picked. Updated unit tests pass: read-attachment.test.ts, stream.test.ts, function-execute-file-mounts.test.ts, list-query*.test.ts, workspace-file-reference.test.ts, list-workspace-files.test.ts, folders/tables/mothership-chats hook tests. These checks pass locally: biome on changed files, check:api-validation:strict, check:react-query, check:boundaries, check:client-boundary, check:utils, check:comment-hygiene, check:test-patterns, check:file-names, and the permission-group enforcement audit. Not run locally, left to CI: full type-check, check:audits, and the integration suites. The UI has not been verified in a browser. 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 Recently Deleted reads one bounded page at a time. The settings page loaded every archived workflow, folder, table, knowledge base, file, file folder and chat in full (tables also ran a pe...

X Description: Summary Recently Deleted reads one bounded page at a time. The settings page loaded every archived workflow, folder, table, knowledge base, file, file folder and chat in full (tables also ran a pe...

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

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:fab38246-8ee0-6ec6-8ff5-33338d5dc370
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8708:3EFFC5:82D03E:B96715:6AFB4D68
html-safe-nonce875a56a1a4aba0f5ea1cf92bf2f6f6c183d87404edd4970fed703935f7c6c68d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzA4OjNFRkZDNTo4MkQwM0U6Qjk2NzE1OjZBRkI0RDY4IiwidmlzaXRvcl9pZCI6IjQwMjM3ODE4MjE0Nzk4NjU3MDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac776edf7910fe366ac60e62ed2b7550fe9993ffa14f31087df062b5e8d3f5d129
hovercard-subject-tagpull_request:4835302315
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/8945/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 Recently Deleted reads one bounded page at a time. The settings page loaded every archived workflow, folder, table, knowledge base, file, file folder and chat in full (tables also ran a pe...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1
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
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8945/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8945%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%2F8945%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/8945/files
Reloadhttps://github.com/simstudioai/sim/pull/8945/files
Reloadhttps://github.com/simstudioai/sim/pull/8945/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)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/bounded-readshttps://github.com/simstudioai/sim/tree/perf/bounded-reads
Conversation 22 https://github.com/simstudioai/sim/pull/8945
Commits 2 https://github.com/simstudioai/sim/pull/8945/commits
Checks 47 https://github.com/simstudioai/sim/pull/8945/checks
Files changed https://github.com/simstudioai/sim/pull/8945/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8945/files
improvement(perf): bound trash, file-path and attachment reads https://github.com/simstudioai/sim/pull/8945/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/8945/files
4a859dd improvement(perf): bound trash, file-path and attachment reads waleedlatif1 Oct 12, 2026 https://github.com/simstudioai/sim/pull/8945/commits/4a859dd906abd0c38ecc14fc6f1fb628c7d7b6af
94289e9 fix(recently-deleted): cast chat ids in the trash union, keep loaded … waleedlatif1 Oct 12, 2026 https://github.com/simstudioai/sim/pull/8945/commits/94289e9cf905442307cb63837347cd28bda50e0d
Clear filters https://github.com/simstudioai/sim/pull/8945/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8945/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8945/files
route.ts https://github.com/simstudioai/sim/pull/8945/files#diff-e92c2b83a25a67fe5089bcb2478fd09dd086feadf68fcdd3037b93f94bf7dbc1
resource.tsx https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
query-plan.ts https://github.com/simstudioai/sim/pull/8945/files#diff-f6aa90aeb35d9de4ecfddd3bc7441a422d672072427abbfa8b56deb3382c9e92
recently-deleted.tsx https://github.com/simstudioai/sim/pull/8945/files#diff-b168e7e8c7e0d495fe4fbfc0398957a43fd1de5b02251b1d09818486206aef4d
search-params.ts https://github.com/simstudioai/sim/pull/8945/files#diff-832f11fddba8d30fa330e42d7de7067716367831ea28434ebc7113bb8e78d520
folders.ts https://github.com/simstudioai/sim/pull/8945/files#diff-fcd03a08650b2640b95989818e3e89e886aa743ccf2921d90ffd3ec1a689f1b1
knowledge.ts https://github.com/simstudioai/sim/pull/8945/files#diff-3567d290a76f48b2b0e1e0e1dc1f71033418f444dc6d1256a280c8e635036211
mothership-chats.ts https://github.com/simstudioai/sim/pull/8945/files#diff-d93326dc7ad3c0d6856933a9ba910634ba50d1e7c3292f43f7aaa85ca2979311
recently-deleted.ts https://github.com/simstudioai/sim/pull/8945/files#diff-44954fe2fa38e974ace16fa7b44c3c958ca74f6722d3923a20b8e5c1c6273e2f
tables.ts https://github.com/simstudioai/sim/pull/8945/files#diff-1d761ed5a7a2ed9ba4435d0f39c5f1f7ac13c177b301c401b38f5a6d731ac8cb
recently-deleted-keys.ts https://github.com/simstudioai/sim/pull/8945/files#diff-376063dbcc4cbc4639cf2270947a47714e34fe284482e9f93adc6e60fc704224
workflows.ts https://github.com/simstudioai/sim/pull/8945/files#diff-0ed3b1c75a5e5cad10d38bbb4baba66c1baf265d534310cd198ff4644dcab388
workspace-file-folders.ts https://github.com/simstudioai/sim/pull/8945/files#diff-7f919b42006635de731f24e6cc0cbff144fc0d0dd583db6010e20006d742099b
workspace-files.ts https://github.com/simstudioai/sim/pull/8945/files#diff-29d9b6d312177176db7c67d2754eb013b3ee7dc842dbbdb481bed86f551d4f37
use-load-more-sentinel.ts https://github.com/simstudioai/sim/pull/8945/files#diff-6491c9df41fe8c6129bfe116f45b2bf17e9646814b1ac077a6db9737a251a92f
recently-deleted.ts https://github.com/simstudioai/sim/pull/8945/files#diff-6b42c5c4773108af94c01d082c0a0bb0f06c911950f2b5841e5aaa8785cdb596
list-query.ts https://github.com/simstudioai/sim/pull/8945/files#diff-32aecd996eadcd96f7be5ec1b731ed5e4221e4d9114ed295dbaa5f5fb13648f0
read-attachment.test.ts https://github.com/simstudioai/sim/pull/8945/files#diff-6376a9555488f67b77d59962fe05e7bb547ac95a1a32e51004c5e7a3c081d982
read-attachment.ts https://github.com/simstudioai/sim/pull/8945/files#diff-39a29da876062b497236381b18623d0df2422ca25d57110e23a093a24b847c26
file-attachments.integration.ts https://github.com/simstudioai/sim/pull/8945/files#diff-857c5fed8b6e2a79190c08a59efdeb54b157e3192927cbbad4c40732203dae73
lifecycle.ts https://github.com/simstudioai/sim/pull/8945/files#diff-5c6b5b0ac8f130fb574fdf2ed39d7ee01d1e79836b4be518f043416a8457f107
file-preview-adapter.test.ts https://github.com/simstudioai/sim/pull/8945/files#diff-9eb4ca85ba3ce6c5a7647916b1111dd50f9951938368978f5d3566fb68563975
file-preview-adapter.ts https://github.com/simstudioai/sim/pull/8945/files#diff-be34920ac6f04923b2cb5ba8d0d7c6d73441a83012474fda6937014f9640113e
stream.test.ts https://github.com/simstudioai/sim/pull/8945/files#diff-a7ec021c41f763ac52cca7a17db786aacfcfb5e55d1f3662f3d6c855cad299fc
function-execute-file-mounts.test.ts https://github.com/simstudioai/sim/pull/8945/files#diff-d53da53503e1f1c5e07337a1a9697832cb5734d5e1523db3029a261e2da683a0
function-execute.ts https://github.com/simstudioai/sim/pull/8945/files#diff-fa78761abb65cfb6be1017873b73a36ea6b20afe26f996788098a262a69fbd6a
file-names.integration.ts https://github.com/simstudioai/sim/pull/8945/files#diff-c16eddc45d1cff843259132f8f8d783931fb6f8b9c010b962fec060040c05e8c
workspace-file-manager.ts https://github.com/simstudioai/sim/pull/8945/files#diff-fcf305d0b37403347596bca42fc6889e9038c9f8e2c69ba20676c0f0d8fead34
list-workspace-files.ts https://github.com/simstudioai/sim/pull/8945/files#diff-c0043b079185e91389f3f511826ca09eada23b70ef9e58e3d610a012ac3396e6
recently-deleted.integration.ts https://github.com/simstudioai/sim/pull/8945/files#diff-4d2a0a3b74d76bd40cbc1107ee77eabe2dd6022d6c19ab66a70df7dd1b34d510
list-recently-deleted.ts https://github.com/simstudioai/sim/pull/8945/files#diff-14b8b28806eb744a954ad4cf5503d241e4c8c8fa74b59f08648b226039598b71
recently-deleted.ts https://github.com/simstudioai/sim/pull/8945/files#diff-4436e91dd1988bd9ddee1aa88c458b289910f655c14230d710e7206656975255
mothership-chat-lifecycle.mock.ts https://github.com/simstudioai/sim/pull/8945/files#diff-0e83bbd3456658f34de1520332a8cfa81369fd80d21ded700e7a4375ecf725d7
workspace-files-list.mock.ts https://github.com/simstudioai/sim/pull/8945/files#diff-6c7d83280c780f86b42d2920c2fc03795bcb67d9b2ca78ca01556befe85e3d4c
check-unused-exports.baseline.json https://github.com/simstudioai/sim/pull/8945/files#diff-4b59a8526a4f226dffb0fbf6b8ec25d3082ab45da697f584eaaca4bd483c928f
apps/sim/app/api/workspaces/[id]/recently-deleted/route.tshttps://github.com/simstudioai/sim/pull/8945/files#diff-e92c2b83a25a67fe5089bcb2478fd09dd086feadf68fcdd3037b93f94bf7dbc1
View file https://github.com/simstudioai/sim/blob/94289e9cf905442307cb63837347cd28bda50e0d/apps/sim/app/api/workspaces/%5Bid%5D/recently-deleted/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8945/{{ revealButtonHref }}
apps/sim/app/workspace/[workspaceId]/components/resource/resource.tsxhttps://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
View file https://github.com/simstudioai/sim/blob/94289e9cf905442307cb63837347cd28bda50e0d/apps/sim/app/workspace/%5BworkspaceId%5D/components/resource/resource.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8945/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
https://github.com/simstudioai/sim/pull/8945/files#diff-0a8b4241a80381381e908b7da57edc5b1a8e7c6f6c9f2ae6d199cb1b2f4c8f22
apps/sim/app/workspace/[workspaceId]/settings/components/recently-deleted/query-plan.tshttps://github.com/simstudioai/sim/pull/8945/files#diff-f6aa90aeb35d9de4ecfddd3bc7441a422d672072427abbfa8b56deb3382c9e92
View file https://github.com/simstudioai/sim/blob/3bfd2246b8cfa081a6afcfa9600d9dc0ed8f8d16/apps/sim/app/workspace/%5BworkspaceId%5D/settings/components/recently-deleted/query-plan.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/simstudioai/sim/pull/8945/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8945/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8945/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.