Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: simstudioai/sim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: simstudioai/sim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/table-dispatcher-coldstart
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 4 files changed
  • 1 contributor

Commits on May 20, 2026

  1. fix(table): cut dispatcher cold-start by lazy-loading heavy import ch…

    …ains
    
    The trigger.dev table-run-dispatcher spent ~6s in module init before its
    first batchTriggerAndWait — it imports lib/table/service for getTableById,
    which eagerly imported lib/table/trigger → @/lib/webhooks/processor →
    webhook-execution + executor, dragging the entire workflow-execution stack
    into the dispatcher container even though it never fires a trigger.
    
    - trigger.ts lazy-imports the webhook processor + polling utils inside
      fireTableTrigger (the only consumer), so importing service no longer pulls
      the executor.
    - buildEnqueueItems only imports the cell job (for the inline `runner`) on the
      database backend; the trigger.dev backend triggers by task id and ignores
      runner.
    TheodoreSpeaks committed May 20, 2026
    Configuration menu
    Copy the full SHA
    158fe3d View commit details
    Browse the repository at this point in the history
  2. fix(table): run counter + gutter Stop update instantly on Run

    The "X running" badge, per-row gutter Stop button, and runningByRowId map
    stayed at zero after clicking Run until a manual refetch. useRunColumn
    optimistically stamped cells pending in the rows cache but never bumped the
    activeDispatches counter — so when the dispatcher's real pending SSE arrived,
    applyCell saw the cell was already in-flight (wasInFlight === isInFlight) and
    skipped the counter delta. The optimistic stamp ate the transition.
    
    - onMutate now bumps runningCellCount / runningByRowId by the cells it stamps,
      snapshotting prior run-state for rollback on error.
    - onSuccess seeds the dispatch into the overlay list from the response instead
      of invalidating activeDispatches (a refetch would reset the optimistic
      counter to the server's still-zero count before the dispatcher stamps).
    TheodoreSpeaks committed May 20, 2026
    Configuration menu
    Copy the full SHA
    c1a7142 View commit details
    Browse the repository at this point in the history
  3. fix(table): drive cell typewriter with rAF so concurrent reveals stay…

    … smooth
    
    The character-by-character reveal used a per-cell setInterval. When many cells
    reveal at once (a Run-all completing in waves), the independent interval
    callbacks fire at uncoordinated times and each forces its own render +
    layout/paint — O(cells) reflows over an un-virtualized grid, so it degrades as
    more cells fill. Switch to requestAnimationFrame: all cells' callbacks run
    before one paint, so React batches them into a single render + paint per frame
    regardless of cell count. Reveal length is derived from elapsed time, so a
    dropped frame catches up instead of slowing the animation.
    TheodoreSpeaks committed May 20, 2026
    Configuration menu
    Copy the full SHA
    248839e View commit details
    Browse the repository at this point in the history
  4. fix(table): roll back optimistic run counter when no dispatch is created

    useRunColumn.onSuccess returned early on a null dispatchId (no matching
    groups / eligible rows) without undoing the onMutate counter bump — and no
    SSE would arrive to correct it, leaving the counter permanently inflated.
    Restore the pre-mutation run-state on that path, mirroring onError.
    TheodoreSpeaks committed May 20, 2026
    Configuration menu
    Copy the full SHA
    22c37ef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    745a5a3 View commit details
    Browse the repository at this point in the history
  6. fix(table): bump run counter on edit/auto-run so Stop shows for queue…

    …d cells
    
    The "X running" badge + per-row gutter Stop only updated on manual Run
    (useRunColumn bumped the run-state counter). Edit-triggered auto-runs
    (useUpdateTableRow, useBatchUpdateTableRows, useCreateTableRow) stamped cells
    pending in the rows cache but never bumped runningCellCount/runningByRowId, so
    Stop stayed hidden even though cells were queued (the counter is already
    queued-inclusive). Extracted countNewlyInFlight + bumpRunState helpers and
    wired them into all the optimistic auto-fire paths with onError rollback;
    reused them in useRunColumn.
    TheodoreSpeaks committed May 20, 2026
    Configuration menu
    Copy the full SHA
    92c55e4 View commit details
    Browse the repository at this point in the history
Loading