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(kb): show 'pending' instead of past date for overdue next sync by waleedlatif1 · Pull Request #4039 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • When a connector's nextSyncAt is in the past (sync overdue / cron delayed), the UI was showing "Next sync: 2 days ago" via formatDistanceToNow. Now shows "Next sync: pending" instead.

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
@waleedlatif1
fix(kb): show 'pending' instead of past date for overdue next sync
7abb202
@cursor

cursor Bot commented Apr 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

PR Summary

Low Risk
Low risk UI-only change that alters how nextSyncAt is displayed when the scheduled time is in the past; no backend or data-flow behavior changes.

Overview
Updates the connectors list UI to treat overdue nextSyncAt values as pending rather than rendering a relative past time (e.g., "2 days ago"). This uses date-fns isPast to conditionally switch the "Next sync" label for active connectors.

Reviewed by Cursor Bugbot for commit 7abb202. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vercel

vercel Bot commented Apr 8, 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 Apr 8, 2026 5:24am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

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

@greptile-apps

greptile-apps Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a UX bug in the knowledge base connectors section where nextSyncAt dates in the past (i.e., syncs that are overdue due to cron delay) were being displayed as relative past timestamps (e.g., "Next sync: 2 days ago") instead of a meaningful pending state indicator.

Changes:

  • Imports isPast from date-fns alongside the existing format and formatDistanceToNow imports.
  • Wraps the formatDistanceToNow call in a ternary: if the nextSyncAt date is already in the past, renders the string "pending" instead of the misleading relative timestamp.

Confidence Score: 5/5

Safe to merge — single-file, display-only change with correct logic.

The change is minimal, targeted, and correct. isPast from date-fns reliably detects overdue dates, and the only remaining finding is a P2 style suggestion about a redundant new Date() construction that has no impact on correctness or performance at this scale.

No files require special attention.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx Adds isPast guard so overdue nextSyncAt displays "pending" instead of a past-relative timestamp; logic is correct and minimal.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ConnectorCard renders next sync info] --> B{connector.nextSyncAt && status === 'active'?}
    B -- No --> C[No next sync shown]
    B -- Yes --> D{isPast nextSyncAt ?}
    D -- Yes overdue --> E["Show: 'Next sync: pending'"]
    D -- No future --> F["Show: 'Next sync: in X minutes/hours'"]
Loading

Reviews (1): Last reviewed commit: "fix(kb): show 'pending' instead of past ..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

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

greptile-apps[bot]
greptile-apps Bot reviewed Apr 8, 2026
View reviewed changes
Comment thread .../workspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.tsx Resolved

Uh oh!

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

@waleedlatif1

waleedlatif1 commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator Author

Re: double new Date() instantiation — Ack. Considered both approaches (IIFE and extracted const). The double new Date() is sub-microsecond and this renders once per connector card, so the readability tradeoff isn't worth it here. Keeping as-is.

All reactions

Sorry, something went wrong.

Uh oh!

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

@waleedlatif1
waleedlatif1 merged commit 7b81a76 into staging Apr 8, 2026
12 checks passed

Uh oh!

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

@waleedlatif1 waleedlatif1 mentioned this pull request Apr 8, 2026
v0.6.30: slack trigger enhancements, secrets performance, polling refactors, drag resources in mothership #4038
Merged
@waleedlatif1
waleedlatif1 deleted the waleedlatif1/fix-kb-next-sync branch April 10, 2026 05:54

This branch was previously deployed

1 inactive deployment
Preview — 7abb202d Deployed Apr 8, 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

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments

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

@waleedlatif1
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.