Repository navigation
Conversation
…gain Removing plan billing (#2, ead5fea) copied cloudPlanLabel into BotLimitPopup without upstream's Object.hasOwn check, and the stub that brought src/lib/cloud-plan.ts back has the same form, so "constructor" or "toString" returned a function. Restore upstream's check and let BotLimitPopup import the one copy.
4 of 5 tasks
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.
What changed
src/lib/cloud-plan.ts:cloudPlanLabelchecksObject.hasOwn(PLAN_LABEL, tier)again, as upstream does. A tier the app does not know reads "Cloud", including one named like anObject.prototypekey.src/components/BotLimitPopup.tsx: drops its private copy ofcloudPlanLabel, which had the same gap, and imports the one incloud-plan.ts.Why
cloudPlanLabel("constructor")andcloudPlanLabel("toString")returnedObject.prototypefunctions instead of "Cloud".PLAN_LABEL[tier] ?? "Cloud"falls through to the prototype for those keys.CloudAccountSettings.test.tschecks exactly this ("names the verified tier… a tier newer than the app reads Cloud").git show ead5fea10^:src/lib/cloud-plan.ts, line 14:Object.hasOwn(PLAN_LABEL, tier) ? PLAN_LABEL[tier] : "Cloud".cloud-plan.tsand copiedcloudPlanLabelinto the files that still used it.src/lib/room-card.tskept the check;BotLimitPopup.tsxlost it.cloud-plan.tsback in the upstream merge 5cfab26 (sync: merge upstream milind-soni/OpenMausBot main (0.1.157) #26, 2026-11-13) has the same form without the check.The tier comes from the Cloud account (
CloudAccountSettings.tsx:147,settings/account-summary.ts:30), so this is the boundary where an unknown value is read. InBotLimitPopupthe label is only shown after an in-app upgrade, which the fork's stubbeduseUpgradenever reports (BotLimitPopup.tsx:50-52), so that copy is unreachable today (read from the code, not run). It goes because it was a second copy of the same decision with the same bug.room-card.tskeeps its own correct copy; this PR leaves it alone.How it was verified
macOS, Node 24.22.1 (the CI version). Before is
main8c67e9d. The script imports the realsrc/lib/cloud-plan.tsand printscloudPlanLabelfor each tier.Before shows a function for
constructorandtoStringand an object for__proto__; after shows "Cloud" for all three.main8c67e9d)cloudPlanLabelforundefined,pro,team,constructor,toString,__proto__Pro,Pro,Cloud,<function>,<function>,<object>Pro,Pro,Cloud,Cloud,Cloud,Cloudpnpm exec vitest run src/components/BotLimitPopup.test.ts src/lib/plan-billing-removed.test.ts src/lib/room-card.test.tsTests 7 failed | 41 passed (48)Tests 7 failed | 41 passed (48), the same 7pnpm exec tsc -boxlint src/lib/cloud-plan.ts src/components/BotLimitPopup.tsxThe 7
BotLimitPopupfailures expect the in-app upgrade that #2 removed. They fail the same way before and after this change and are fixed separately with the other tests for removed features.CloudAccountSettings.test.ts's tier case still fails onmainbefore it reaches the label: it renders the account card, which the sign-in stub shows as signed out (expected '<section …' to contain '>Pro<'). The tests-for-removed-features PR narrows that case tocloudPlanLabelitself and keeps theconstructorandtoStringrows; with this PR it passes.Not covered
BotLimitPopup's upgraded title, unreachable as above.Checklist