René's URL Explorer Experiment


Title: refactor(audit): derive updatedFields through one shared helper by waleedlatif1 · Pull Request #6604 · simstudioai/sim · GitHub

Open Graph Title: refactor(audit): derive updatedFields through one shared helper by waleedlatif1 · Pull Request #6604 · simstudioai/sim

X Title: refactor(audit): derive updatedFields through one shared helper by waleedlatif1 · Pull Request #6604 · simstudioai/sim

Description: Summary Six copies of Object.keys(updateData).filter(k => k !== 'updatedAt') across four files each decided independently which columns an audit row reports. The updatedAt exclusion is an audit convention, not a local detail, so it moves to @sim/audit as auditUpdatedFields and becomes a single edit Fixes a real inconsistency along the way: v1/admin/organizations/[id]/route.ts evaluated the expression twice in one handler and filed it under the metadata key fields, while every other site uses updatedFields. Any consumer filtering on updatedFields silently missed org updates. Verified nothing reads metadata.fields before renaming Follow-up to #6598 and #6602, which converged the MCP paths onto reporting written columns Sites converted File Was lib/mcp/orchestration/server-lifecycle.ts:403 inline lib/mcp/orchestration/workflow-mcp-lifecycle.ts:552, :939 inline ×2 lib/credentials/orchestration/index.ts:339 inline app/api/v1/admin/organizations/[id]/route.ts:182, :193 inline ×2, double-evaluated, key fields Testing-mock note auditMock carries the real implementation, not a vi.fn() stub — callers under test derive their audit metadata through it, so stubbing would erase exactly what those tests assert. The two suites that hand-roll their own @sim/audit factory (credentials/orchestration, workflow-mcp-lifecycle) source it from auditMock rather than re-inlining, so there is still one implementation. Type of Change Refactor Testing New packages/audit/src/updated-fields.test.ts: written columns, updatedAt dropped, explicitly-null columns kept (clearing a value is a change), and the only-updatedAt empty case 933 tests pass across lib/mcp, lib/credentials, lib/copilot/tools/handlers/deployment, app/api/mcp, app/api/v1/admin, app/api/v2/mcp; 29 in packages/audit lint:check and check:api-validation:strict pass; typecheck clean Local-verification caveat worth knowing: this was developed in a git worktree whose node_modules symlinks to the main checkout, so @sim/audit and @sim/testing resolve to the main copy and a new package export is invisible to the worktree's test run. Every result above was produced by temporarily materializing the two package files into the main checkout, running, then restoring it — otherwise the run reports phantom failures that look like this change breaking 100+ audit-mocking suites. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing 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 Six copies of Object.keys(updateData).filter(k => k !== 'updatedAt') across four files each decided independently which columns an audit row reports. The updatedAt exclusion is ...

X Description: Summary Six copies of Object.keys(updateData).filter(k => k !== 'updatedAt') across four files each decided independently which columns an audit row reports. The updatedAt e...

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

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:5f42bddc-601a-594a-6141-5582a92e17fc
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9A86:1B6493:784846:A5C9CC:6AFB45C4
html-safe-nonce926ff817a60a52a50c997b944dc4e04cee4c1da7be2587fe67cd9d7ca99141fe
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTg2OjFCNjQ5Mzo3ODQ4NDY6QTVDOUNDOjZBRkI0NUM0IiwidmlzaXRvcl9pZCI6IjcwNjAyMjkzMTM1NTA1NjY4NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb5283e3a01b8c17ae29114600ab1a699314ab76e67785adb71402ee589d6c049
hovercard-subject-tagpull_request:4259277897
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/6604/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 Six copies of Object.keys(updateData).filter(k => k !== 'updatedAt') across four files each decided independently which columns an audit row reports. The updatedAt exclusion is ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd
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
releasea6c2f87cbcb6414452377b4967858ed6a66f1109
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6604/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6604%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%2F6604%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/6604/files
Reloadhttps://github.com/simstudioai/sim/pull/6604/files
Reloadhttps://github.com/simstudioai/sim/pull/6604/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests199 (199)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
refactor/audit-updated-fields-helperhttps://github.com/simstudioai/sim/tree/refactor/audit-updated-fields-helper
Conversation 10 https://github.com/simstudioai/sim/pull/6604
Commits 2 https://github.com/simstudioai/sim/pull/6604/commits
Checks 30 https://github.com/simstudioai/sim/pull/6604/checks
Files changed https://github.com/simstudioai/sim/pull/6604/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6604/files
refactor(audit): derive updatedFields through one shared helper https://github.com/simstudioai/sim/pull/6604/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/6604/files
307d3ed refactor(audit): derive updatedFields through one shared helper waleedlatif1 Aug 12, 2026 https://github.com/simstudioai/sim/pull/6604/commits/307d3edf7fc4a700f14b611ba6cff31b9f1f45ee
9c6d5b6 test(audit): pin the testing mock's copy of auditUpdatedFields waleedlatif1 Aug 12, 2026 https://github.com/simstudioai/sim/pull/6604/commits/9c6d5b6b6f71876131732479083830f18bc64810
Clear filters https://github.com/simstudioai/sim/pull/6604/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6604/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6604/files
route.ts https://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
index.test.ts https://github.com/simstudioai/sim/pull/6604/files#diff-97e5e31aa58873f3e1388f92be70dd82af42cfc2123fbb818d20bffe5eed6e69
index.ts https://github.com/simstudioai/sim/pull/6604/files#diff-2fc2e4aa7edc1851a28264eadfca64761f021e141a2cfced411e9a506929c612
server-lifecycle.ts https://github.com/simstudioai/sim/pull/6604/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
workflow-mcp-lifecycle.test.ts https://github.com/simstudioai/sim/pull/6604/files#diff-62203e1bb97518f7850a9a40855196e7d19e8a4e0bc2738cc0610f510269c92b
workflow-mcp-lifecycle.ts https://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
index.ts https://github.com/simstudioai/sim/pull/6604/files#diff-efa1c5be4335b6e5bd47b06318a1ec61cc1982b7daf8e989b51b220168b293c9
updated-fields.test.ts https://github.com/simstudioai/sim/pull/6604/files#diff-306386550bd679aa929e29df7e4399079c64c29ac2420c00d4cddde8808ddcf4
updated-fields.ts https://github.com/simstudioai/sim/pull/6604/files#diff-0c44352faa8a9579327a720a93d336412ac1bce1e06ebafe6025944172016122
audit.mock.ts https://github.com/simstudioai/sim/pull/6604/files#diff-ddbf3f281bccb1e55eb3765c29403087addedc24fb5f99c437c69a9a412c1e91
apps/sim/app/api/v1/admin/organizations/[id]/route.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/apps/sim/app/api/v1/admin/organizations/%5Bid%5D/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
https://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
https://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
https://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
https://github.com/simstudioai/sim/pull/6604/files#diff-1bfa772f13e527c88ac75cc743c8a55ac963438336b8aa905771ebbc66c9d378
apps/sim/lib/credentials/orchestration/index.test.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-97e5e31aa58873f3e1388f92be70dd82af42cfc2123fbb818d20bffe5eed6e69
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/apps/sim/lib/credentials/orchestration/index.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-97e5e31aa58873f3e1388f92be70dd82af42cfc2123fbb818d20bffe5eed6e69
https://github.com/simstudioai/sim/pull/6604/files#diff-97e5e31aa58873f3e1388f92be70dd82af42cfc2123fbb818d20bffe5eed6e69
apps/sim/lib/credentials/orchestration/index.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-2fc2e4aa7edc1851a28264eadfca64761f021e141a2cfced411e9a506929c612
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/apps/sim/lib/credentials/orchestration/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-2fc2e4aa7edc1851a28264eadfca64761f021e141a2cfced411e9a506929c612
https://github.com/simstudioai/sim/pull/6604/files#diff-2fc2e4aa7edc1851a28264eadfca64761f021e141a2cfced411e9a506929c612
https://github.com/simstudioai/sim/pull/6604/files#diff-2fc2e4aa7edc1851a28264eadfca64761f021e141a2cfced411e9a506929c612
apps/sim/lib/mcp/orchestration/server-lifecycle.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/apps/sim/lib/mcp/orchestration/server-lifecycle.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6604/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
https://github.com/simstudioai/sim/pull/6604/files#diff-0680f8bc617e13ef336c024a3a18671af0b7fd2658f55f5de274b33a97de9581
apps/sim/lib/mcp/orchestration/workflow-mcp-lifecycle.test.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-62203e1bb97518f7850a9a40855196e7d19e8a4e0bc2738cc0610f510269c92b
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/apps/sim/lib/mcp/orchestration/workflow-mcp-lifecycle.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-62203e1bb97518f7850a9a40855196e7d19e8a4e0bc2738cc0610f510269c92b
https://github.com/simstudioai/sim/pull/6604/files#diff-62203e1bb97518f7850a9a40855196e7d19e8a4e0bc2738cc0610f510269c92b
apps/sim/lib/mcp/orchestration/workflow-mcp-lifecycle.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/apps/sim/lib/mcp/orchestration/workflow-mcp-lifecycle.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
https://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
https://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
https://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
https://github.com/simstudioai/sim/pull/6604/files#diff-246cec60627688425291ce2cbb23f7aa294bf11618a3ca5aa8b1cadd57cf0c60
packages/audit/src/index.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-efa1c5be4335b6e5bd47b06318a1ec61cc1982b7daf8e989b51b220168b293c9
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/packages/audit/src/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/6604/files
packages/audit/src/updated-fields.test.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-306386550bd679aa929e29df7e4399079c64c29ac2420c00d4cddde8808ddcf4
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/packages/audit/src/updated-fields.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
packages/audit/src/updated-fields.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-0c44352faa8a9579327a720a93d336412ac1bce1e06ebafe6025944172016122
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/packages/audit/src/updated-fields.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
packages/testing/src/mocks/audit.mock.tshttps://github.com/simstudioai/sim/pull/6604/files#diff-ddbf3f281bccb1e55eb3765c29403087addedc24fb5f99c437c69a9a412c1e91
View file https://github.com/simstudioai/sim/blob/9c6d5b6b6f71876131732479083830f18bc64810/packages/testing/src/mocks/audit.mock.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6604/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6604/files#diff-ddbf3f281bccb1e55eb3765c29403087addedc24fb5f99c437c69a9a412c1e91
Please reload this pagehttps://github.com/simstudioai/sim/pull/6604/files
https://github.com/simstudioai/sim/pull/6604/files#diff-ddbf3f281bccb1e55eb3765c29403087addedc24fb5f99c437c69a9a412c1e91
Please reload this pagehttps://github.com/simstudioai/sim/pull/6604/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.