Blacksmith optimizations created based on Blacksmith support ticket 2052 with Waleed#2054
Closed
ConnorMul wants to merge 16 commits intosimstudioai:mainfrom
Closed
Blacksmith optimizations created based on Blacksmith support ticket 2052 with Waleed#2054ConnorMul wants to merge 16 commits intosimstudioai:mainfrom
ConnorMul wants to merge 16 commits intosimstudioai:mainfrom
Conversation
…oai#1608) * improvement(performance): remove unused source/target indices, add index on snapshot id (simstudioai#1603) * fix(blog): rename building to blogs with redirect (simstudioai#1604) * improvement(privacy-policy): updated privacy policy for google (simstudioai#1602) * updated privacy policy for google * update terms, privacy, and emails to incl address and update verbiage * feat(guardrails): added guardrails block/tools and docs (simstudioai#1605) * Adding guardrails block * ack PR comments * cleanup checkbox in dark mode * cleanup * fix supabase tools * fix(inference-billing): fix inference billing when stream is true via API, add drag-and-drop functionality to deployed chat (simstudioai#1606) * fix(inference): fix inference billing when stream is true via API * add drag-and-drop to deployed chat * feat(mistal): added mistral as a provider, updated model prices (simstudioai#1607) * feat(mistal): added mistral as a provider, updated model prices * remove the ability for a block to reference its own outluts * fixed order of responses for guardrails block * feat(versions): added the ability to rename deployment versions (simstudioai#1610) * fix(vulns): fix various vulnerabilities and enhanced code security (simstudioai#1611) * fix(vulns): fix SSRF vulnerabilities * cleanup * cleanup * regen docs * remove unused deps * fix failing tests * cleanup * update deps * regen bun lock
…ad support for more blocks
…hboard improvements
) * fix(debug-mode): remove duplicate debug mode flag (simstudioai#1714) * feat(i18n): update translations (simstudioai#1709) * improvement(condition): added variable and envvar highlighting for condition input (simstudioai#1718) * fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data (simstudioai#1719) * fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data * apps/sim * renaming * remove relative import * feat(tools): added webflow OAuth + tools (simstudioai#1720) * feat(tools): added webflow OAuth + tools * remove itemId from delete item * remove siteId * added webhook triggers + oauth scopes + site/collection selector * update sample payload for webflow triggers * cleanup * fix discord color * feat(i18n): update translations (simstudioai#1721) * improvement(schedule): fix UI bug with schedule modal (simstudioai#1722)
* fix(already-cancelled-sub): UI should allow restoring subscription * restore functionality fixed * fix
…cp improvements, local kb file storage
…e performance. please review before pushing to production
|
Someone is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile Summary
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant UI as "Cancel Subscription Component"
participant API as "Better Auth API"
participant DB as "Database"
participant Stripe as "Stripe API"
User->>UI: "Click Restore Button"
UI->>UI: "Determine subscription type (personal/org)"
UI->>API: "betterAuthSubscription.restore({referenceId, subscriptionId?})"
API->>DB: "Query subscription by referenceId"
DB-->>API: "Return subscription data"
API->>Stripe: "Update subscription (cancel_at_period_end: false)"
Stripe-->>API: "Return updated subscription"
API->>DB: "Update cancelAtPeriodEnd = false"
DB-->>API: "Confirm update"
API-->>UI: "Return success"
UI->>UI: "Refresh subscription state"
UI->>User: "Show restored subscription"
|
Contributor
There was a problem hiding this comment.
17 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
Comment on lines
+41
to
+44
| or( | ||
| eq(subscriptionTable.status, 'active'), | ||
| eq(subscriptionTable.cancelAtPeriodEnd, true) | ||
| ) |
Contributor
There was a problem hiding this comment.
logic: Query logic incorrectly uses or() - subscriptions with cancelAtPeriodEnd=true should still have status='active', not be an alternative condition
Suggested change
| or( | |
| eq(subscriptionTable.status, 'active'), | |
| eq(subscriptionTable.cancelAtPeriodEnd, true) | |
| ) | |
| and( | |
| eq(subscriptionTable.status, 'active'), | |
| eq(subscriptionTable.cancelAtPeriodEnd, true) | |
| ) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/api/billing/portal/route.ts
Line: 41:44
Comment:
**logic:** Query logic incorrectly uses `or()` - subscriptions with `cancelAtPeriodEnd=true` should still have `status='active'`, not be an alternative condition
```suggestion
and(
eq(subscriptionTable.status, 'active'),
eq(subscriptionTable.cancelAtPeriodEnd, true)
)
```
How can I resolve this? If you propose a fix, please make it concise.
Collaborator
|
@ConnorMul can we rebase, and I'll get this merged in right away. And make this PR against staging instead of against main. thanks! |
Collaborator
|
merged in #2055 |
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.
Summary
Brief description of what this PR does and why.
Fixes #(issue)
Type of Change
Testing
How has this been tested? What should reviewers focus on?
Checklist
Screenshots/Videos