GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(logs, workflows): snapshot fetch optionality, restore consistent draft read snapshots by icecrasher321 · Pull Request #6594 · simstudioai/sim

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Don't always need snapshot data
  • Restore consistent draft read snapshots

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Vikhyath Mondreti added 2 commits August 11, 2026 21:14
Vikhyath Mondreti
fix(logs): snapshot fetch optionality
a4400b4
Vikhyath Mondreti
fix(workflows): restore consistent draft read snapshots
3125237
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 4:21am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Aug 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches workflow draft-read and log-detail query paths, including stronger workspace scoping on snapshot loads. Incorrect filtering or join changes could affect read correctness or access boundaries.

Overview
Avoids loading unused execution snapshots in log detail, and restores consistent, workspace-scoped draft workflow reads.

fetchLogDetail no longer goes through getPublicWorkflowLog (which joined workflowExecutionSnapshots / user). It queries the detail fields it needs directly, so log detail no longer materializes heavy workflowState snapshot data.

Draft readWorkflowDefinition now uses the canonical loadWorkflowReadSnapshot path (same consistent transaction as other reads) instead of loading normalized tables alone. loadWorkflowReadSnapshot also requires workspaceId and filters the workflow row by workspace + non-archived at query time; callers like readWorkflow are updated accordingly.

Reviewed by Cursor Bugbot for commit 3125237. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR avoids fetching unused execution snapshots for internal log details and restores consistent workflow-row and draft-state reads within one repeatable-read transaction.

  • Replaces the broad public-log query with a workspace-scoped detail query that omits unused snapshot and owner joins.
  • Requires workflow read snapshots to be scoped to the canonical workspace and active workflow.
  • Uses the canonical snapshot for draft workflow-definition responses while preserving immutable deployment-state reads.
  • Adds focused tests for log-query optionality and draft snapshot consistency.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or non-blocking defects identified.

The replacement log query preserves all fields used by log-detail responses, and every workflow snapshot caller supplies the canonical workspace while retaining authorization and active-workflow checks.

Important Files Changed

Filename Overview
apps/sim/lib/logs/fetch-log-detail.ts Replaces a broad shared query with a workspace-scoped query that retains consumed fields while avoiding unused snapshot and user joins.
apps/sim/lib/workflows/queries.ts Extends repeatable-read snapshots with canonical workspace and active-workflow filtering.
apps/sim/lib/workflows/application/read-workflow-definition.ts Returns draft metadata and normalized state from the same snapshot while leaving deployed reads on the deployment-state path.
apps/sim/lib/workflows/application/read-workflow.ts Passes the canonical context workspace into the newly scoped snapshot query.
apps/sim/lib/logs/fetch-log-detail.test.ts Verifies internal log details no longer fetch execution snapshots or workflow-owner data.
apps/sim/lib/workflows/application/read-workflow-definition.test.ts Covers consistent draft snapshots, invalid snapshot records, and preservation of deployed-state behavior.

Sequence Diagram

sequenceDiagram
  participant Caller
  participant UseCase as Authorized workflow use case
  participant Context as Context resolver
  participant DB as PostgreSQL
  Caller->>UseCase: Read draft workflow
  UseCase->>Context: Resolve active workflow and workspace
  Context->>DB: Load canonical active workflow
  DB-->>Context: Workflow context
  UseCase->>DB: Begin REPEATABLE READ snapshot
  par Consistent draft state
    DB->>DB: Load normalized workflow tables
  and Consistent workflow metadata
    DB->>DB: Load active workflow scoped by workspace
  end
  DB-->>UseCase: Workflow record and normalized state
  UseCase-->>Caller: Consistent draft definition
Loading

Reviews (1): Last reviewed commit: "fix(workflows): restore consistent draft..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321
icecrasher321 merged commit eb26b42 into staging Aug 12, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1 waleedlatif1 mentioned this pull request Aug 12, 2026
v0.8.0: desktop app, workflow UI, v2 endpoints #6606
Merged
@waleedlatif1
waleedlatif1 deleted the fix/logs-perf branch August 12, 2026 09:10

This branch was previously deployed

1 inactive deployment
Preview — 3125237f Deployed Aug 12, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@icecrasher321
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.