Skip to content

Conversation

ung0v
Copy link

@ung0v ung0v commented Jul 17, 2025

Summary

This PR implements full support for resumable streams in Zola, enabling seamless user experience during network interruptions or page refreshes.

Technical Implementation

  • Redis Integration

    • Redis is now a required service.
    • Added the REDIS_URL environment variable for configuration.
    • Updated setup documentation with instructions for running Redis.
  • Database & Schema Updates

    • Added a new stream_ids table to track and resume chat streaming sessions.
    • Updated SQL schema and TypeScript types to support this feature.
  • Backend Enhancements

    • Chat API endpoints now support resumable streams, allowing users to resume interrupted or ongoing chat streams.
    • Added logic for generating and tracking unique stream session IDs for each chat using a local generateUUID function.
  • Frontend Improvements

    • The frontend is extended to auto-resume chat streams on page load if needed.
    • Introduced a new useAutoResume hook to handle auto-resume logic.

Motivation

This enhancement resolves zola#197 and is based on modern resumable stream patterns, including reference designs from Vercel Resumable Stream and AI SDK docs. These techniques ensure Zola delivers reliable real-time experiences even in unreliable network conditions.

References

Testing

  • Manually verified session recovery after page refresh.

Copy link

vercel bot commented Jul 17, 2025

@ung0v is attempting to deploy a commit to the zola Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Jul 19, 2025

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

Name Status Preview Comments Updated (UTC)
zola-anfe ❌ Failed (Inspect) Jul 19, 2025 9:03am

Copy link

@ErRickow ErRickow left a comment

Choose a reason for hiding this comment

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

can be use the @uptash/redish from vercel marketplace? or its for local redis?

@ung0v
Copy link
Author

ung0v commented Jul 22, 2025

can be use the @uptash/redish from vercel marketplace? or its for local redis?

you can integrate redis in Vercel marketplace

@ibelick
Copy link
Owner

ibelick commented Jul 25, 2025

thank you @ung0v, this looks great.
would it be possible to make it optional? would love to keep setup minimal, also please update the INSTALL.md

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.

Add support for Resumable Streams
3 participants