René's URL Explorer Experiment


Title: fix(settings): report a failed settings write instead of reporting success by waleedlatif1 · Pull Request #7023 · simstudioai/sim · GitHub

Open Graph Title: fix(settings): report a failed settings write instead of reporting success by waleedlatif1 · Pull Request #7023 · simstudioai/sim

X Title: fix(settings): report a failed settings write instead of reporting success by waleedlatif1 · Pull Request #7023 · simstudioai/sim

Description: The route cannot fail app/api/users/me/settings/route.ts:75 } catch (error: any) { logger.error(`[${requestId}] Settings update error`, error) return NextResponse.json({ success: true }, { status: 200 }) } A failed upsert is answered exactly like a successful one. Which makes the client's rollback unreachable useUpdateGeneralSetting (hooks/queries/general-settings.ts:166) is a full optimistic mutation: onMutate writes the new value into the cache and calls syncThemeToNextThemes onError restores context.previousSettings and re-syncs the theme requestJson throws ApiClientError only on a non-2xx. Since the route always answered 200, onError could never run — the rollback and its theme re-sync are dead code. What the user sees The upsert throws (pool exhaustion, a conflict on settings.userId, a replica failover). The UI applies the change. Nothing is persisted. onSettled invalidates, the refetch returns the old value, and the setting quietly reverts with no error anywhere. For a consent-shaped setting — telemetry, email opt-out — the user believes they opted out and did not. The fix The catch returns 500, which is what the mutation was already written to handle. No client change needed. Deliberately not changed GET still falls back to defaultUserSettings on error, also at 200. Failing it would take the settings page down on a transient read, and whether that trade is right is a separate judgement from this one. Worth noting it compounds the above — a failing GET makes the post-write refetch show defaults — but the write path is the one making a false claim. Testing A route test drives the failure through the real handler rather than asserting on a mock: ✓ reports success when the write lands ✓ reports failure when the write throws Verified it can fail — restoring the 200 turns the second case red with expected 200 to be 500. bun run type-check clean; 41 tests passing across app/api/users and the settings hook.

Open Graph Description: The route cannot fail app/api/users/me/settings/route.ts:75 } catch (error: any) { logger.error(`[${requestId}] Settings update error`, error) return NextResponse.json({ success: true }, { stat...

X Description: The route cannot fail app/api/users/me/settings/route.ts:75 } catch (error: any) { logger.error(`[${requestId}] Settings update error`, error) return NextResponse.json({ success: true }, { stat...

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

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:8c5fbadf-3119-b5d8-c7de-f2d317783c95
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id90F6:1BB96C:10351AC:162CBF1:6AFB646A
html-safe-nonce25c09618f442c043e00a7d1057fe3bf156ce20f51103a4fb72726d24bd1a981b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEY2OjFCQjk2QzoxMDM1MUFDOjE2MkNCRjE6NkFGQjY0NkEiLCJ2aXNpdG9yX2lkIjoiMTgxODg5NjU5Njk5Mzc5NTE3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7b77a563c1a2074098aa1a84bbe3366f3e882ef2c8a17578f0266300c0ed10da
hovercard-subject-tagpull_request:4344737153
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/7023/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:altThe route cannot fail app/api/users/me/settings/route.ts:75 } catch (error: any) { logger.error(`[${requestId}] Settings update error`, error) return NextResponse.json({ success: true }, { stat...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
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
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7023/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7023%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%2F7023%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/7023/files
Reloadhttps://github.com/simstudioai/sim/pull/7023/files
Reloadhttps://github.com/simstudioai/sim/pull/7023/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
fix-settings-success-on-failurehttps://github.com/simstudioai/sim/tree/fix-settings-success-on-failure
Conversation 3 https://github.com/simstudioai/sim/pull/7023
Commits 1 https://github.com/simstudioai/sim/pull/7023/commits
Checks 30 https://github.com/simstudioai/sim/pull/7023/checks
Files changed https://github.com/simstudioai/sim/pull/7023/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7023/files
fix(settings): report a failed settings write instead of reporting success https://github.com/simstudioai/sim/pull/7023/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/7023/files
c4b6c13 fix(settings): report a failed settings write instead of reporting su… waleedlatif1 Aug 24, 2026 https://github.com/simstudioai/sim/pull/7023/commits/c4b6c131bca07719eb327ee8699cb5c59f0e0092
Clear filters https://github.com/simstudioai/sim/pull/7023/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7023/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7023/files
route.test.ts https://github.com/simstudioai/sim/pull/7023/files#diff-0671436917ec5bee09f7e8642dbefc0a5d9831e5c5df98e0a7b2e844310fdb1e
route.ts https://github.com/simstudioai/sim/pull/7023/files#diff-a61824a5dfc6631ecb6344ffeaa44bd37e2936bc7794fe3e9e9df5145a0b6e62
apps/sim/app/api/users/me/settings/route.test.tshttps://github.com/simstudioai/sim/pull/7023/files#diff-0671436917ec5bee09f7e8642dbefc0a5d9831e5c5df98e0a7b2e844310fdb1e
View file https://github.com/simstudioai/sim/blob/c4b6c131bca07719eb327ee8699cb5c59f0e0092/apps/sim/app/api/users/me/settings/route.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7023/{{ revealButtonHref }}
apps/sim/app/api/users/me/settings/route.tshttps://github.com/simstudioai/sim/pull/7023/files#diff-a61824a5dfc6631ecb6344ffeaa44bd37e2936bc7794fe3e9e9df5145a0b6e62
View file https://github.com/simstudioai/sim/blob/c4b6c131bca07719eb327ee8699cb5c59f0e0092/apps/sim/app/api/users/me/settings/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7023/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7023/files#diff-a61824a5dfc6631ecb6344ffeaa44bd37e2936bc7794fe3e9e9df5145a0b6e62
Please reload this pagehttps://github.com/simstudioai/sim/pull/7023/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.