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

WebSocket: Refreshing list view when record is created/updated #2389

Open
Kharg opened this issue Jul 24, 2022 · 7 comments
Open

WebSocket: Refreshing list view when record is created/updated #2389

Kharg opened this issue Jul 24, 2022 · 7 comments

Comments

@Kharg
Copy link
Contributor

Kharg commented Jul 24, 2022

It would be good to have WebSocket support for list view, so when a record is created/updated the row gets highlighted on the list view and you can see updates in realtime., this is an important feature missing from Espo.

@yurikuzn
Copy link
Contributor

yurikuzn commented Aug 9, 2022

This is difficult to implement design-wise. Refreshing the whole list is not an option, it would be hindering for a user. The only acceptable option would be inserting new items into the list on their positions honoring the current sorting.

@Kharg
Copy link
Contributor Author

Kharg commented Aug 9, 2022

Inserting new items into the list would still be a huge improvement.

@yurikuzn
Copy link
Contributor

yurikuzn commented Aug 9, 2022

It's not that easy as one might think. Too many issues, too many cases. What if 100 records have been added.

Updating is difficult too. Should we subscribe to each rendered record? Too many subscriptions is not good. Should we listen to any record being updated and then re-fetch? What if there're many users and many records being updated each second.

I don't see any good solution.

@Kharg
Copy link
Contributor Author

Kharg commented Sep 19, 2022

I had an idea, what about giving admin the option to select entities which will have WebSocket enabled for list view? With a tooltip message warning about not enabling it for entities which gets a lot of record added at the same time?

@kczereczon
Copy link

I think that subscribe for create event is easy to implement by your own with custom list views, but as Yuri said implementing the update listeners foreach record on list views is server killer and you should be careful with it.

For create event you should use this.collection.fetch method

@SuchAFuriousDeath
Copy link
Contributor

Just as a big sidenote, I think this could be done in Postgres using LISTEN and NOTIFY without having to listen to each individual record, but obviously, it's not reasonable to have a Postgres-only feature of such magnitude.

@Kharg
Copy link
Contributor Author

Kharg commented Mar 17, 2023

I have developed my custom websocket event for list view, but it's really buggy as of now.

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

No branches or pull requests

4 participants