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

Always emit document event #2135

Closed
Aschen opened this issue Sep 6, 2021 · 2 comments
Closed

Always emit document event #2135

Aschen opened this issue Sep 6, 2021 · 2 comments

Comments

@Aschen
Copy link
Contributor

Aschen commented Sep 6, 2021

Feature Description

Developers often want to react to modification happening in the database directly from the backend side.

If modification are made from the API then we can use pipes (generic:document:* events) or a realtime subscription.

If modification are made from the backend, we can only use realtime subscription.

Generic Document events could always be triggered, even if it's from the backend so backend developers can plug pipes on those events and react on every database modification

@xbill82
Copy link
Contributor

xbill82 commented Sep 6, 2021

I completely agree on this. If I remember well, the choice of not triggering those events when updates came from the backend itself, was in order to prevent infinite loops provoked by hooks or pipes that would re-trigger the same event.
IMHO, we can leave this responsibility to the end-developer and just warn them in the documentation. Does this make sense to you?

@Aschen
Copy link
Contributor Author

Aschen commented Sep 6, 2021

Yes totally. It still can be a friction point for developers debugging infinite loop but if there is only one category of events that may cause this and if it's well documented then I think we can do it. Specially because it adds a lot of value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants