Skip to content

v0.3.26: fix billing, bubble up workflow block errors, credentials security improvements#967

Merged
icecrasher321 merged 3 commits intomainfrom
staging
Aug 14, 2025
Merged

v0.3.26: fix billing, bubble up workflow block errors, credentials security improvements#967
icecrasher321 merged 3 commits intomainfrom
staging

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Aug 14, 2025

icecrasher321 and others added 2 commits August 14, 2025 12:18
…flow block" (#965)

* Revert "fix(workflow-block): revert change bubbling up error for workflow blo…"

This reverts commit 9f0993e.

* revert test changes
@vercel
Copy link

vercel bot commented Aug 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim (staging) Ready Preview Comment Aug 14, 2025 7:17pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs ⬜️ Skipped Aug 14, 2025 7:17pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR implements two key improvements to the Sim workflow execution system:

1. Workflow Error Propagation Enhancement

The primary change reverts a previous modification that was preventing proper error handling in nested workflow executions. The WorkflowBlockHandler now properly bubbles up errors from child workflows to parent workflows by:

  • Explicitly checking if child workflow execution returns success: false and throwing an error with enhanced context
  • Implementing smart error message handling to prevent duplication in deeply nested scenarios
  • Updating all related tests to expect thrown exceptions instead of returned error objects

This ensures that when a child workflow fails, the parent workflow also fails appropriately rather than continuing execution or silently ignoring the failure.

2. Billing Environment Variable Separation

The second major change addresses a Next.js architecture issue by properly separating client-side and server-side billing configuration:

  • Adds NEXT_PUBLIC_BILLING_ENABLED as a new client-side environment variable alongside the existing server-side BILLING_ENABLED
  • Updates multiple React components (Sidebar, SettingsModal, SettingsNavigation) to use getEnv('NEXT_PUBLIC_BILLING_ENABLED') instead of server-side utilities
  • Follows Next.js best practices where NEXT_PUBLIC_ prefixed variables are safely exposed to the browser

This change enables client-side components to properly determine billing status for conditional UI rendering while maintaining server-side billing logic separation. The implementation integrates with the existing environment variable system and maintains backward compatibility with server-side billing functionality.

Confidence score: 3/5

  • This PR contains potentially breaking changes to error handling behavior that could affect workflow execution patterns
  • Score reflects concerns about type safety in environment variable handling and the fundamental change to error propagation patterns
  • Pay close attention to apps/sim/executor/handlers/workflow/workflow-handler.ts and the billing-related React components for proper error handling and environment variable access

7 files reviewed, 3 comments

Edit Code Review Bot Settings | Greptile

const subscription = getSubscriptionStatus()

// Get billing status
const isBillingEnabled = getEnv('NEXT_PUBLIC_BILLING_ENABLED') || false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: getEnv returns string | undefined but you're using || false which could result in truthy strings like 'false' being treated as true. Consider using the isTruthy utility from @/lib/env for proper boolean conversion.

)

// If the child workflow failed, throw an error to trigger proper error handling in the parent
if ((mappedResult as any).success === false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Type assertion to any bypasses TypeScript safety. Consider defining a proper interface for the mapped result structure.

Context Used: Context - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used to maintain type safety. (link)

const isLoading = workflowsLoading || sessionLoading

// Get billing status
const isBillingEnabled = getEnv('NEXT_PUBLIC_BILLING_ENABLED') || false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Type safety concern: getEnv() returns string | undefined, but isBillingEnabled is used as boolean. Consider using a proper boolean conversion like getEnv('NEXT_PUBLIC_BILLING_ENABLED') === 'true' instead of relying on falsy check with || false.

Suggested change
const isBillingEnabled = getEnv('NEXT_PUBLIC_BILLING_ENABLED') || false
const isBillingEnabled = getEnv('NEXT_PUBLIC_BILLING_ENABLED') === 'true'

…er, fix google sheets block url split bug (#968)

* improvement(credentials-sharing-security): cleanup and reuse helper to determine credential access

* few more routes

* fix google sheets block

* fix test mocks

* fix calendar route
@vercel vercel bot temporarily deployed to Preview – docs August 14, 2025 19:13 Inactive
@icecrasher321 icecrasher321 changed the title v0.3.26: fix billing, bubble up workflow block errors v0.3.26: fix billing, bubble up workflow block errors, credentials security improvements Aug 14, 2025
@icecrasher321 icecrasher321 merged commit e1f04f4 into main Aug 14, 2025
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants