Skip to content

feat(listings): implement live reload for new listings using SSE#361

Merged
orangecoding merged 4 commits into
orangecoding:masterfrom
RaminGe:feature/live-reload
Jul 9, 2026
Merged

feat(listings): implement live reload for new listings using SSE#361
orangecoding merged 4 commits into
orangecoding:masterfrom
RaminGe:feature/live-reload

Conversation

@RaminGe

@RaminGe RaminGe commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This PR implements real-time silent live-reloading for the listings overview page.

Currently when new listings are fetched and stored by background/scheduled jobs, users on the Listings page do not see them unless they manually reload the page. This breaks the seamless real-time feel of the application.

Solution:
We leverage Fredys existing SSE architecture to silently reload the listings state in the background.

Backend:

  • Automatically dispatches a listings:new event through SSE to the user when new listings are added to the database

Frontend:

  • Subscribed to the /api/jobs/events SSE channel
  • Refetches the listings page silently when a listings:new event is received

Comment thread lib/FredyPipelineExecutioner.js
try {
const data = JSON.parse(e.data || '{}');
if (data && data.count) {
loadDataRef.current();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

If I understand correctly, you call the loadData function, so you got the new listings via sse, still load everything? What if a user is currently checking something on page 2? This would route the user back to page 1 and could be pretty confusing? How about instead showing a small popover at the top of the current view: "There's new data available, click here to reload"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea I thought about that issue too. It's a bit different tho, if a user is on page 2 (or has filters applied or whatever) it would reload page 2. That still would mean that it changes the page slightly.

I thought a live reload is nicer because it happens automatic, but I get your point.
What if we live reload only if a user is on page 1, otherwise show a toast/popover? Or do you wanna stick to the popover for all cases?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think having it consistent would be better, so showing a popover..

Thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, I've added the Banner which is also used elsewhere above the table

@orangecoding orangecoding left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks

@orangecoding
orangecoding merged commit ff87a5d into orangecoding:master Jul 9, 2026
2 checks passed
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.

2 participants