Skip to content

fix(6s-timeout): 6 seconds timeout for sockets server warning #645

Merged
icecrasher321 merged 1 commit intostagingfrom
fix/add-back06s
Jul 9, 2025
Merged

fix(6s-timeout): 6 seconds timeout for sockets server warning #645
icecrasher321 merged 1 commit intostagingfrom
fix/add-back06s

Conversation

@icecrasher321
Copy link
Collaborator

Description

Only show warning after 6 seconds after disconnection.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jul 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 9, 2025 6:53pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 9, 2025 6:53pm

@icecrasher321 icecrasher321 merged commit 24e19a8 into staging Jul 9, 2025
3 of 5 checks passed
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.

PR Summary

Implements a 6-second delay before showing offline mode warning in socket disconnections to prevent false positives from brief network interruptions.

  • Modified apps/sim/app/workspace/[workspaceId]/w/components/providers/workspace-permissions-provider.tsx to include a 6-second setTimeout before triggering the offline warning
  • Added cleanup function to prevent memory leaks from timeout handlers
  • Maintains existing requirement for page refresh to restore edit permissions after disconnection

1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Comment on lines +90 to +93
const timeoutId = setTimeout(() => {
setIsOfflineMode(true)
}, 6000)
return () => clearTimeout(timeoutId)
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider extracting timeout duration (6000) to a named constant at the top of the file for better maintainability

@delve-auditor
Copy link

delve-auditor bot commented Jul 9, 2025

No security or compliance issues detected. Reviewed everything up to 4e679af.

Security Overview
  • 🔎 Scanned files: 1 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► document.tsx
    Add 6s timeout for page navigation
► use-knowledge.ts
    Simplified chunk pagination and search logic
Refactor ► search-highlight.tsx
    Remove unused component
► package.json
    Remove fuse.js dependency
► bun.lock
    Update dependencies

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@waleedlatif1 waleedlatif1 deleted the fix/add-back06s branch July 10, 2025 22:25
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net>
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.

1 participant