Conversation
fix:Account Management Status
|
Warning Rate limit exceeded@seefs001 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 40 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
WalkthroughAdds optional chaining and unified account rendering in AccountManagement.jsx; injects an Umami analytics script into served HTML at runtime via an Changes
Sequence Diagram(s)sequenceDiagram
participant Server
participant Env as Environment
participant Template as index.html (template)
participant Client
Note over Server,Env: Server startup / request-time preparation
Server->>Env: read UMAMI_WEBSITE_ID, UMAMI_SCRIPT_URL
alt UMAMI_WEBSITE_ID present
Server->>Server: build <script data-website-id="..."> tag (using UMAMI_SCRIPT_URL or default)
else no UMAMI_WEBSITE_ID
Server->>Server: skip analytics injection
end
Server->>Template: load HTML template (contains <analytics></analytics>)
alt script built
Server->>Template: replace "<analytics></analytics>\n" with script tag
end
Server->>Client: serve final HTML
sequenceDiagram
participant AdminUI as Admin UI (Settings)
participant API as Backend API
participant Options as Option Store / model
participant StripeCtrl as topup_stripe controller
participant Stripe as Stripe API
AdminUI->>API: submit Stripe settings (StripePromotionCodesEnabled = true/false)
API->>Options: update option "StripePromotionCodesEnabled" -> "true"/"false"
Note over StripeCtrl,Options: When creating checkout session
StripeCtrl->>Options: read setting StripePromotionCodesEnabled
StripeCtrl->>Stripe: create Checkout Session with AllowPromotionCodes = <setting>
Stripe->>StripeCtrl: return session
StripeCtrl->>AdminUI: respond with session info / redirect
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
web/src/components/settings/personal/cards/AccountManagement.jsx (1)
183-183: Fix redundant user existence check.The condition
userState.user && userState.user?.wechat_idis redundant since optional chaining already handles the null/undefined case. TheuserState.usercheck is unnecessary.Apply this diff to simplify the condition:
- {userState.user && userState.user?.wechat_id + {userState.user?.wechat_id
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/src/components/settings/personal/cards/AccountManagement.jsx(3 hunks)
🔇 Additional comments (2)
web/src/components/settings/personal/cards/AccountManagement.jsx (2)
168-171: LGTM! Consistent use of optional chaining and renderAccountInfo utility.The WeChat display implementation now consistently uses optional chaining and leverages the
renderAccountInfoutility function, which provides a standardized way to display account information with proper fallback handling and popover functionality.
302-302: LGTM! Proper use of optional chaining.The Telegram binding check correctly uses optional chaining, which is consistent with the other changes in this file and provides safe property access.
feat: support UMAMI analytics
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
main.go (1)
164-164: Make the analytics placeholder replacement resilient to line-ending differences.
bytes.ReplaceAllis searching for<analytics></analytics>\n. If the embeddedweb/dist/index.htmlhappens to be written with Windows-style\r\n(which Vite or manual edits can produce), the placeholder never matches and Umami is silently skipped. Please switch to a newline-agnostic replacement so the feature keeps working regardless of how the file was generated.Apply this diff to make the replacement resilient:
- indexPage = bytes.ReplaceAll(indexPage, []byte("<analytics></analytics>\n"), []byte(analyticsInject)) + indexPage = bytes.ReplaceAll(indexPage, []byte("<analytics></analytics>\r\n"), []byte(analyticsInject+"\r\n")) + indexPage = bytes.ReplaceAll(indexPage, []byte("<analytics></analytics>\n"), []byte(analyticsInject+"\n"))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
main.go(3 hunks)web/index.html(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Push Docker image to multiple registries
feat: allow stripe promotion code
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
controller/topup_stripe.go(1 hunks)model/option.go(2 hunks)setting/payment_stripe.go(1 hunks)web/src/components/settings/PaymentSetting.jsx(1 hunks)web/src/i18n/locales/en.json(1 hunks)web/src/i18n/locales/zh.json(1 hunks)web/src/pages/Setting/Payment/SettingsPaymentGatewayStripe.jsx(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- web/src/i18n/locales/zh.json
🧰 Additional context used
🧬 Code graph analysis (3)
controller/topup_stripe.go (1)
setting/payment_stripe.go (1)
StripePromotionCodesEnabled(8-8)
model/option.go (2)
common/constants.go (1)
OptionMap(36-36)setting/payment_stripe.go (1)
StripePromotionCodesEnabled(8-8)
web/src/pages/Setting/Payment/SettingsPaymentGatewayStripe.jsx (1)
web/src/components/settings/PaymentSetting.jsx (1)
inputs(30-49)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Push Docker image to multiple registries
🔇 Additional comments (6)
controller/topup_stripe.go (1)
228-230: LGTM! Clean integration of promotion codes feature.The implementation correctly integrates the new
StripePromotionCodesEnabledsetting into the Stripe Checkout session configuration. The code follows established patterns in the codebase and properly sources the configuration from the setting module.setting/payment_stripe.go (1)
8-8: LGTM! Proper initialization of new configuration variable.The new
StripePromotionCodesEnabledvariable is correctly declared with a sensible default value offalse, following the established pattern for other Stripe-related configuration variables in this file.web/src/components/settings/PaymentSetting.jsx (1)
48-48: LGTM! Consistent addition to input state.The new
StripePromotionCodesEnabledfield is properly added to the inputs state with the correct default value (false) and follows the established naming convention for other Stripe-related settings.web/src/i18n/locales/en.json (1)
840-840: LGTM! Clear and descriptive translation key.The English translation for the Stripe promotion codes feature is clear, descriptive, and follows the established pattern for other UI strings in the localization file.
model/option.go (2)
85-85: LGTM! Proper initialization in option map.The new
StripePromotionCodesEnabledoption is correctly added to the initialization map using the appropriate boolean-to-string conversion function, consistent with other boolean settings in the codebase.
334-335: LGTM! Correct option handling logic.The option update logic properly handles the new
StripePromotionCodesEnabledsetting by converting the string value to boolean and assigning it to the appropriate setting variable, following the established pattern for other boolean configuration options.
| StripePromotionCodesEnabled: | ||
| props.options.StripePromotionCodesEnabled !== undefined | ||
| ? props.options.StripePromotionCodesEnabled | ||
| : false, | ||
| }; |
There was a problem hiding this comment.
Fix: Normalize StripePromotionCodesEnabled to a boolean before binding
submitStripeSetting stores the option as the strings 'true'/'false', but here we feed that raw value back into Form.Switch. Semi UI treats any non-empty string as truthy, so an option saved as 'false' renders the switch ON and makes it impossible to reflect the real state. Coerce the value to an actual boolean when hydrating currentInputs.
- StripePromotionCodesEnabled:
- props.options.StripePromotionCodesEnabled !== undefined
- ? props.options.StripePromotionCodesEnabled
- : false,
+ StripePromotionCodesEnabled:
+ props.options.StripePromotionCodesEnabled !== undefined
+ ? typeof props.options.StripePromotionCodesEnabled === 'string'
+ ? props.options.StripePromotionCodesEnabled.toLowerCase() === 'true'
+ : !!props.options.StripePromotionCodesEnabled
+ : false,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| StripePromotionCodesEnabled: | |
| props.options.StripePromotionCodesEnabled !== undefined | |
| ? props.options.StripePromotionCodesEnabled | |
| : false, | |
| }; | |
| StripePromotionCodesEnabled: | |
| props.options.StripePromotionCodesEnabled !== undefined | |
| ? typeof props.options.StripePromotionCodesEnabled === 'string' | |
| ? props.options.StripePromotionCodesEnabled.toLowerCase() === 'true' | |
| : !!props.options.StripePromotionCodesEnabled | |
| : false, |
🤖 Prompt for AI Agents
In web/src/pages/Setting/Payment/SettingsPaymentGatewayStripe.jsx around lines
67 to 71, the StripePromotionCodesEnabled value is passed raw (sometimes the
string 'true'/'false') into Form.Switch; coerce it to a real boolean when
hydrating currentInputs by checking for the boolean true or the string 'true'
(e.g. set StripePromotionCodesEnabled =
props.options.StripePromotionCodesEnabled === true ||
props.options.StripePromotionCodesEnabled === 'true', otherwise false) so the
switch reflects the actual saved state.
feat: gemini urlContext
feat: if video cannot play open in a new tab
feat: add duplicate key removal function when edit or add new channel
The hardcoded codex CLI version (0.104.0) causes upstream rejection when using gpt-5.5 with compact, as the server treats the request as an outdated client and returns 400/502. Update codexCLIVersion, codexCLIUserAgent, and openAICodexProbeVersion to 0.125.0 to match the current Codex CLI release. Fixes QuantumNous#1933, QuantumNous#1887, QuantumNous#1865 Related: QuantumNous#1609, QuantumNous#1298, QuantumNous#849
Summary by CodeRabbit
Bug Fixes
UX Improvements
New Features
Refactor