Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clear react caches when stream is errored #1898

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

msfstef
Copy link
Contributor

@msfstef msfstef commented Oct 29, 2024

Fixes #1690

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

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

Thanks!


streamCache.set(shapeHash, newShapeStream)
const newShapeStream = new ShapeStream<T>(options)
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps move this logic inside the if error clause?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same logic applies if there is no prior shape stream, which is why I left them outside.

  • Shape stream exists
    • Errored or aborted -> delete cached and create new
    • Working fine -> return cached
  • Shape stream does not exist
    • create new


shapeCache.set(shapeStream, newShape)
const newShape = new Shape<T>(shapeStream)
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 03f2125
🔍 Latest deploy log https://app.netlify.com/sites/electric-next/deploys/6721014341f7420008f02f6f
😎 Deploy Preview https://deploy-preview-1898--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@msfstef msfstef merged commit 9bd3673 into main Oct 29, 2024
23 checks passed
@msfstef msfstef deleted the msfstef/clear-shape-cache-on-errors-and-aborts branch October 29, 2024 15:56
KyleAMathews pushed a commit that referenced this pull request Nov 1, 2024
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.

Delete shapes from the react integrations cache if it's aborted
2 participants